Elements do not fit here, so horizontal scrolling is needed. Added by. But it turned out for each line separately. And I would like to insert a single horizontal scrolling for the entire activation. I tried to insert several linearLayots into one HorizontalScrollView - it does not work. Can't it be done? enter image description here

enter image description here

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:context=".ActivitySolar" tools:showIn="@layout/activity_solar"> <HorizontalScrollView android:layout_width="wrap_content" android:layout_height="wrap_content"> <LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/textView7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Минимальный расход воды" /> <EditText android:id="@+id/editText3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="10" android:inputType="textPersonName" android:text="Name" /> <TextView android:id="@+id/textView6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Qmin (л/с)" /> </LinearLayout> </HorizontalScrollView> <HorizontalScrollView android:layout_width="wrap_content" android:layout_height="wrap_content"> <LinearLayout android:id="@+id/linearLayout2" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/textView8" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Коэффициент полезного действия микроГЭСа," /> <EditText android:id="@+id/editText2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="10" android:inputType="textPersonName" android:text="Name" /> <TextView android:id="@+id/textView5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Н (м)" /> </LinearLayout> </HorizontalScrollView> </LinearLayout> 
  • @Jarvis_J ScrollView for vertical scrolling? I do not need this. - Oleg Khegay

1 answer 1

Try wrapping all your views into a parent layout:

 <HorizontalScrollView> <FrameLayout> ... весь остальной код... </FrameLayout> </HorizontalScrollView> 
  • with this arrangement, two lines appear on one ... Straight one overlaps the other. - Oleg Khegay
  • Then, instead of <FrameLayout> playing with others: <LinearLayout orientation: vertical> - Vadym Gryganskiy
  • one
    the point is to wrap all the blocks in one parent, which, in turn, is inside <HorizontalScrollView> - Vadym Gryganskiy