Я хочу добавить вид прокрутки к относительной компоновке, потому что у меня было больше кнопок, когда я увеличивал количество кнопок и запускал их на своем мобильном устройстве. Я не видел некоторых кнопок, поэтому хочу добавить прокрутку для кнопки. Как я могу добавить его? Ниже мой XML-кодЯ хочу добавить Свиток в Buuton?
<RelativeLayout 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:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity"
android:background="@drawable/background1">
<include layout="@layout/header" />
<include layout="@layout/footer" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/header"
android:layout_above="@+id/footer"
>
<Button
android:id="@+id/templesbtn"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Historical"
style="?android:attr/buttonStyleSmall"
android:background="@drawable/mymenubuttons"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"/>
<Button
android:id="@+id/resortsbtn"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Resorts"
style="?android:attr/buttonStyleSmall"
android:background="@drawable/mymenubuttons"
android:layout_marginBottom="10dp"
android:layout_below="@+id/templesbtn"/>
<Button
android:id="@+id/shoppingmallsbtn"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Shopping"
style="?android:attr/buttonStyleSmall"
android:background="@drawable/mymenubuttons"
android:layout_marginBottom="10dp"
android:layout_below="@+id/resortsbtn"/>
<Button
android:id="@+id/theatersbtn"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Theaters"
style="?android:attr/buttonStyleSmall"
android:background="@drawable/mymenubuttons"
android:layout_marginBottom="10dp"
android:layout_below="@+id/shoppingmallsbtn"/>
<Button
android:id="@+id/restaurantsbtn"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Restaurants"
style="?android:attr/buttonStyleSmall"
android:background="@drawable/mymenubuttons"
android:layout_marginBottom="10dp"
android:layout_below="@+id/theatersbtn"
/>
<Button
android:id="@+id/hospitalbtn"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Hospitals"
style="?android:attr/buttonStyleSmall"
android:background="@drawable/mymenubuttons"
android:layout_marginBottom="10dp"
android:layout_below="@+id/restaurantsbtn"
/>
<Button
android:id="@+id/collegebtn"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Colleges"
style="?android:attr/buttonStyleSmall"
android:background="@drawable/mymenubuttons"
android:layout_marginBottom="10dp"
android:layout_below="@+id/hospitalbtn"
/>
<Button
android:id="@+id/onlineservicebtn"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Online Services"
style="?android:attr/buttonStyleSmall"
android:background="@drawable/mymenubuttons"
android:layout_marginBottom="10dp"
android:layout_below="@+id/collegebtn"
/>
<RelativeLayout
android:layout_toRightOf="@+id/templesbtn"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<GridView
android:id="@+id/gridView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:numColumns="2"
android:visibility="invisible" >
</GridView>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
кто может мне помочь?
просто оберните относительный макет, содержащий ваши кнопки, с прокруткой. – Bhargav
Но в моем относительном расположении есть еще один относительный макет –
и есть один относительный макет, обертывающий ваши кнопки, насколько я могу видеть из вашего кода, просто оберните это относительная компоновка с видом прокрутки – Bhargav