我无法在底部显示LinearLayout来滚动视图 [英] I can't show LinearLayout at bottom to scroll view
本文介绍了我无法在底部显示LinearLayout来滚动视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用下面的xml代码中的布局
I am working with layout like in below xml code
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/title" >
</RelativeLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="none">
<RelativeLayout
android:id="@+id/rel2"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button1"
android:layout_width="250dp"
android:layout_height="50dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:background="@drawable/bkg_gold_btn"
android:text="Button 1" />
/*--------------------------------*/
/* there are 12 more Buttons Here */
/*--------------------------------*/
<Button
android:id="@+id/button10"
android:layout_width="250dp"
android:layout_height="50dp"
android:layout_below="@+id/button9"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:layout_marginTop="5dp"
android:background="@drawable/bkg_gold_btn"
android:text="Button 14" />
</RelativeLayout>
</ScrollView>
<LinearLayout
android:id="@+id/add_layer"
android:layout_width="fill_parent"
android:layout_height="50dip"
>
</LinearLayout>
</LinearLayout>
但是当我运行代码时,我在底部看不到LinearLayout. 请帮助我.
But when I run the code I could not see LinearLayout at Bottom. please help me.
推荐答案
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/reltop"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@drawable/title" >
</RelativeLayout>
<ScrollView
android:layout_below="@id/reltop"
android:layout_above="@id/add_layer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="none">
<RelativeLayout
android:id="@+id/rel2"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button1"
android:layout_width="250dp"
android:layout_height="50dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:background="@drawable/bkg_gold_btn"
android:text="Button 1" />
/*--------------------------------*/
/* there are 12 more Buttons Here */
/*--------------------------------*/
<Button
android:id="@+id/button10"
android:layout_width="250dp"
android:layout_height="50dp"
android:layout_below="@+id/button9"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:layout_marginTop="5dp"
android:background="@drawable/bkg_gold_btn"
android:text="Button 14" />
</RelativeLayout>
</ScrollView>
<LinearLayout
android:id="@+id/add_layer"
android:layout_width="fill_parent"
android:layout_alignParentBottom="true"
android:layout_height="50dip"
>
</LinearLayout>
</RelativeLayout>
这篇关于我无法在底部显示LinearLayout来滚动视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文