Task: display a dialog containing text and a list with three items to choose from. The text of the items and the preceding text of the dialogue is too large in the number of characters. Thus, it is required either to add a horizontal scroll bar, or to reduce the size of the text of the dialogue elements.

How to implement at least one of the visible options? There are no methods to control text parameters for objects of the Dialog class. In the included markup file, I also clearly do not see solutions, since list items are added programmatically, but in fact it is not known, these are TextViews or something else.

Tried to add a HorizontalScrollView as follows:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toast_layout" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="10dp" android:background="#F00B"> <HorizontalScrollView android:id="@+id/horizon" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/lin" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> </LinearLayout> </HorizontalScrollView> </FrameLayout> 

I assume that all content is somewhere between the <LinearLayout> , </LinearLayout> . In fact, by launching the application, when you click a button, a dialog is displayed without any scroll bars. In general, it turns out this:

emulator snapshot

    1 answer 1

    Why horizontal scrolling?

     <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toast_layout" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="10dp" android:background="#F00B"> <ScrollView> <LinearLayout android:id="@+id/lin" android:orientation="vertical" android:scrollbars="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbarAlwaysDrawVerticalTrack="true"> ... </LinearLayout> </ScrollView> </FrameLayout> 
    • 2Vitozz The text of the list items does not fit exactly in length. The width of everything is ok. - zugzug