ListView is not displayed in the visual editor. Only: Item 1 Sub Item 1; Item 2 Sub Item 2; Item 3 Sub Item 3 , etc. to the end of the screen.
LinearLayout is used in vertical orientation. And two ListViews are not located one above the other, but one above the other (this is only in the visual editor. In this case, I am interested in a visa. Editor).
activity_main.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity"> <ListView android:id="@+id/list_options1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:entries="@array/options1" /> <ListView android:id="@+id/list_options2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:entries="@array/options2" /> </LinearLayout> strings.xml
<resources> <string name="app_name">Простейшее</string> <string-array name="options1"> <item>Пункт_1</item> <item>Пункт_2</item> <item>Пункт_3</item> </string-array> <string-array name="options2"> <item>Пункт_4</item> <item>Пункт_5</item> <item>Пункт_6</item> </string-array> </resources> Well, the MainActivity that the studio has created.
I tried to place two ListViews not one under the other, but side by side with the horizontal orientation LinearLayout well, and, of course, changed android: layout_width, android: layout_height to wrap_content . The result is the same as in the first case - only Item 1 Sub Item 1; Item 2 Sub Item 2; Item 3 Sub Item 3 , etc. Just starting to figure it out. Help me please