48 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			XML
		
	
	
	
			
		
		
	
	
			48 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			XML
		
	
	
	
| <?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> |