pda/zhuike/.svn/pristine/c8/c8b0afef955bc64fa4d555cfe01...

48 lines
2.3 KiB
XML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/book_pop"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:background="@color/read_dialog_bg"
android:orientation="horizontal"
android:id="@+id/linearLayout">
<ImageButton
android:id="@+id/btn_return"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/return_button"
android:layout_marginLeft="10dp"
android:layout_gravity="center_vertical" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:orientation="horizontal">
<!-- android:gravity 属性是对该view中内容的限定比如一个button 上面的text. 你可以设置该text 相对于view的靠左靠右等位置
android:layout_gravity是用来设置该view相对与父view 的位置比如一个button 在linearlayout里你想把该button放在linearlayout里靠左、靠右等位置就可以通过该属性设置
即android:gravity用于设置View中内容相对于View组件的对齐方式而android:layout_gravity用于设置View组件相对于Container的对齐方式。
当Linear Layout为水平时可以设置上下 当Linear Layout为垂直时可以设置左右 -->
<ImageButton
android:id="@+id/btn_light"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@color/black" />
<ImageButton
android:id="@+id/btn_listener_book"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="10dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>