There is a markup of the form:

<RelativeLayout xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background" tools:context="ru.mail.xaxa.InndexActivity" > <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="55dp" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:background="#2196f3" > </android.support.v7.widget.Toolbar> <View android:id="@+id/view1" android:layout_width="match_parent" android:layout_height="6dp" android:layout_alignParentLeft="true" android:layout_below="@+id/toolbar" android:background="@drawable/toolbar_dropshadow" /> <ImageButton android:id="@+id/imageButton1" android:layout_width="100dp" android:layout_height="145dp" android:layout_alignParentLeft="true" android:layout_below="@+id/view1" android:layout_marginLeft="37dp" android:layout_marginTop="55dp" android:background="@null" android:src="@drawable/lenin" /> <ImageButton android:id="@+id/imageButton2" android:layout_width="100dp" android:layout_height="145dp" android:layout_alignParentRight="true" android:layout_alignTop="@+id/imageButton1" android:layout_marginRight="37dp" android:background="@null" android:src="@drawable/dedchit" /> </RelativeLayout> 

How do I add ScrollView here? I tried to wrap it all in but failed. I would be grateful for the help!

  • one
  • What does "failed" mean? What were the problems? The code is not copy-protected? =) - JuriySPb
  • @YuriSPb was a crash from the application. did as indicated in the responses from the user pavlofff link, but it turned out that toolBarr will scroll .... - iKey
  • Add to the question (sure!) That there was a crash and attach the StackTrace error from logCat (also required!). And always do this for every question. And the toolbar will scroll, because I scroll everything in myself. - Yuriy SPb
  • @YuriiSPb I seem to understand what the problem is. thank. I will consider everything - iKey

1 answer 1

try this

 <RelativeLayout xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background" tools:context="ru.mail.xaxa.InndexActivity" > <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="55dp" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:background="#2196f3" > </android.support.v7.widget.Toolbar> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/toolbar"> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <View android:id="@+id/view1" android:layout_width="match_parent" android:layout_height="6dp" android:layout_alignParentLeft="true" android:layout_below="@+id/toolbar" android:background="@drawable/toolbar_dropshadow" /> <ImageButton android:id="@+id/imageButton1" android:layout_width="100dp" android:layout_height="145dp" android:layout_alignParentLeft="true" android:layout_below="@+id/view1" android:layout_marginLeft="37dp" android:layout_marginTop="55dp" android:background="@null" android:src="@drawable/lenin" /> <ImageButton android:id="@+id/imageButton2" android:layout_width="100dp" android:layout_height="145dp" android:layout_alignParentRight="true" android:layout_alignTop="@+id/imageButton1" android:layout_marginRight="37dp" android:background="@null" android:src="@drawable/dedchit" /> </RelativeLayout> </ScrollView> </RelativeLayout>