Can not see Button at bottom
in Xm开发者_StackOverflow中文版l file i can not see button at bottom my code is here 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">
<RelativeLayout android:layout_width="fill_parent"
android:background="@drawable/navigationbar" android:layout_below="@+id/top"
android:id="@+id/toptext" android:layout_height="50dip">
<Button android:layout_width="wrap_content" android:background="@drawable/back"
android:textStyle="bold" android:layout_height="wrap_content"
android:paddingLeft="10dip" android:layout_margin="10dip" android:id="@+id/back"
android:layout_alignParentLeft="true"></Button>
<TextView android:layout_width="wrap_content" android:text="@string/source_of_stress"
android:textSize="20dip" android:layout_marginLeft="100dip"
android:layout_marginTop="8dip" android:layout_height="wrap_content"
android:textColor="#FFFFFF" android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout android:orientation="horizontal"
android:id="@+id/date" android:layout_below="@+id/toptext"
android:gravity="center" android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button android:id="@+id/previous" android:background="@drawable/left_arrow"
android:visibility="gone" android:layout_marginTop="15dip"
android:layout_marginLeft="10dip" android:layout_alignParentLeft="true"
android:layout_width="20dip" android:layout_height="23dip"
android:textColor="#FFFFFFFF" />
<RelativeLayout android:layout_width="fill_parent"
android:background="@drawable/datebar"
android:layout_centerHorizontal="true" android:layout_height="wrap_content"
android:paddingLeft="10dip" android:paddingRight="10dip">
<TextView android:id="@+id/currentDate" android:textSize="19sp"
android:layout_centerHorizontal="true" android:layout_marginTop="10dip"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textColor="#2972cc" android:text="Monday" android:textStyle="bold" />
<Button android:id="@+id/next" android:background="@drawable/right_arrow"
android:visibility="gone" android:layout_marginTop="15dip"
android:layout_marginRight="10dip" android:layout_alignParentRight="true"
android:layout_width="20dip" android:layout_height="23dip"
android:textColor="#FFFFFFFF" />
</RelativeLayout>
</RelativeLayout>
<!--
<TextView android:layout_width="wrap_content"
android:visibility="gone" android:textSize="11sp"
android:layout_marginLeft="8dip" android:layout_below="@+id/date"
android:id="@+id/all_sos_text" android:layout_marginTop="5dip"
android:layout_height="wrap_content"></TextView> <ScrollView
android:id="@+id/list_scroll" android:layout_marginBottom="55dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_below="@+id/date"
android:layout_marginTop="5dip" android:fadingEdge="none"
android:scrollbars="none">
-->
<ScrollView android:id="@+id/sos_scroll"
android:layout_marginBottom="82dip" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_below="@+id/date"
android:layout_marginTop="5dip" android:fadingEdge="none"
android:scrollbars="none">
<LinearLayout android:layout_width="fill_parent"
android:id="@+id/sos_lin" android:layout_height="wrap_content"
android:orientation="vertical">
<ListView android:paddingLeft="1dip" android:scrollbars="none"
android:cacheColorHint="#00000000" android:focusable="true"
android:id="@+id/list" android:dividerHeight="2dip"
android:footerDividersEnabled="false" android:headerDividersEnabled="false"
android:layout_marginRight="12dip" android:listSelector="@android:color/transparent"
android:background="@drawable/newshape_list"
android:layout_marginLeft="12dip" android:paddingRight="1dip"
android:layout_height="230dip" android:layout_width="fill_parent"
android:fadingEdge="none" android:divider="#A9ABAD"></ListView>
<RelativeLayout android:layout_width="wrap_content"
android:layout_marginLeft="10dip" android:layout_marginBottom="50dip"
android:layout_marginRight="10dip" android:layout_height="wrap_content"
android:layout_below="@+id/list">
<TableLayout android:layout_width="wrap_content"
android:id="@+id/add_table" android:layout_centerHorizontal="true"
android:background="@drawable/listback" android:layout_height="wrap_content"
android:stretchColumns="1">
<TableRow android:id="@+id/add_data">
<ImageView android:layout_width="wrap_content"
android:src="@drawable/addbuttonimage" android:id="@+id/que1"
android:layout_height="wrap_content"></ImageView>
<TextView android:text="Add New Stress..."
android:layout_width="wrap_content" android:textStyle="bold"
android:textColor="#000000" android:layout_marginLeft="5dip"
android:textSize="15sp" android:layout_height="wrap_content"
android:padding="3dip" />
</TableRow>
</TableLayout>
</RelativeLayout>
</LinearLayout>
</ScrollView>
<RelativeLayout android:layout_gravity="center_horizontal"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:layout_below="@+id/sos_scroll" android:id="@+id/donerel"
android:layout_marginTop="5dip" android:layout_centerHorizontal="true">
<Button android:textColor="#FFFFFF" android:text="Save"
android:layout_width="wrap_content" android:textStyle="bold"
android:background="@drawable/savebutton" android:layout_height="wrap_content"
android:id="@+id/done"></Button>
</RelativeLayout>
The reason that the layout is not showing is layout_marginBottom="82dip"
on the ScrollView
So changing:
<ScrollView android:id="@+id/sos_scroll"
android:layout_marginBottom="82dip" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_below="@+id/date"
android:layout_marginTop="5dip" android:fadingEdge="none"
android:scrollbars="none">
to for example:
<ScrollView android:id="@+id/sos_scroll"
android:layout_marginBottom="1dip" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_below="@+id/date"
android:layout_marginTop="5dip" android:fadingEdge="none"
android:scrollbars="none">
should help.
精彩评论