1
工作,我有这样的布局为什么安卓layout_above不
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/comments_list" android:layout_gravity="center"
android:layout_below="@+id/phone_editText" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_above="@+id/bottom_container"
android:layout_alignRight="@+id/search_btn" android:layout_alignEnd="@+id/search_btn"/>
<AutoCompleteTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/phone_editText"
android:hint="enter phone"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="blocked"
android:id="@+id/isBlocked_cb"
android:layout_toStartOf="@+id/phone_editText"
android:layout_toLeftOf="@+id/phone_editText"
android:layout_above="@+id/comments_list"
android:checked="true" android:layout_alignParentTop="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"/>
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="search"
android:id="@+id/search_btn"
android:layout_toEndOf="@+id/phone_editText"
android:layout_toRightOf="@+id/phone_editText"
android:layout_above="@+id/comments_list"
android:layout_alignParentTop="true" android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:onClick="foo"/>
<RelativeLayout android:id="@+id/bottom_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true">
<AutoCompleteTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/comment_text"
android:hint="enter comment"
android:layout_alignParentBottom="true" android:layout_centerHorizontal="true"/>
<Button style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Add" android:id="@+id/add_btn"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@+id/comment_text" android:layout_alignTop="@+id/comment_text"/>
</RelativeLayout>
<LinearLayout
android:focusable="true" android:focusableInTouchMode="true"
android:layout_width="0px" android:layout_height="0px"/>
</RelativeLayout>
我想bottom_container
要低于我的ListView
,但在模拟器上,他们似乎在另一个之上:
实际问题是什么?问题?,你试过的东西.. – Hacketo
对不起。图像未被上传 –
layout_alignParentBottom上的bottom_container对齐底部到父亲relativeLayout,应该尝试删除这个 – Hacketo