Issue in relative layout with scrollview
Please review the following GUI code.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/frameLayout1" android:layout_width="fill_parent" android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android">
<Button android:id="@+id/button1" android:text="Continue" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_alignParentTop="true" android:layout_alignParentRight="true" android:layout_marginRight="22dp"></Button>
<ScrollView android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="500px"
android:layout_marginTop="60dp"
>
<RelativeLayout android:id="@+id/relativeLayout1" android:layout_width="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="426dp">
<TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/editText1" android:layout_alignParentLeft="true" android:layout_marginTop="32dp" android:text="@strin开发者_开发知识库g/dealerNoString" android:textStyle="bold"></TextView>
<EditText android:layout_width="150dip" android:layout_height="wrap_content" android:id="@+id/editText1" android:layout_alignBaseline="@+id/textView1" android:layout_alignBottom="@+id/textView1" android:layout_toRightOf="@+id/textView2" android:layout_marginLeft="19dp"></EditText>
<EditText android:layout_width="150dip" android:layout_height="wrap_content" android:id="@+id/editText2" android:layout_alignBaseline="@+id/textView2" android:layout_alignBottom="@+id/textView2" android:layout_alignLeft="@+id/editText1"></EditText>
<TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:text="@string/DealerString" android:layout_height="wrap_content" android:textStyle="bold" android:layout_alignParentLeft="true" android:layout_marginTop="43dp"></TextView>
<TextView android:id="@+id/textView3"
android:layout_width="wrap_content" android:text="@string/orderString" android:layout_height="wrap_content" android:textStyle="bold" android:layout_below="@+id/editText2" android:layout_alignParentLeft="true" android:layout_marginTop="32dp"></TextView>
<EditText android:layout_width="150dip" android:layout_height="wrap_content" android:id="@+id/editText3" android:layout_alignBaseline="@+id/textView3" android:layout_alignBottom="@+id/textView3" android:layout_alignLeft="@+id/editText2">
</EditText>
<TextView android:layout_width="wrap_content" android:id="@+id/textView4" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_alignParentLeft="true" android:textStyle="bold" android:text="@string/addressString"></TextView>
<EditText android:layout_width="150dip" android:id="@+id/editText4" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_alignLeft="@+id/editText3"></EditText>
<EditText android:layout_width="wrap_content" android:id="@+id/editText5" android:layout_height="wrap_content" android:layout_below="@+id/editText4" android:layout_alignLeft="@+id/editText4" android:layout_marginLeft="23dp" android:layout_marginTop="26dp">
<requestFocus></requestFocus>
</EditText>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
I have placed fours text edits smoothly when when trying to place fifth it automatically moves to the top of layout.I tried for many times .Please help
Did you check set the android:layout_marginTop property of that 5th layout element?
精彩评论