RelativeLayoutは指定されたコントロールを一番上に置きます

<?xml version = "1.0" encoding = "utf-8" ?>
 <RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android"
 android :layout_width = "match_parent"
 android :layout_height = " match_parent "
 android :background = " @ color / white " >
     <android.support.v7.widget.RecyclerView
 android :id = " @ + id / test_recycler_view "
 android :layout_width = " match_parent "
 android :layout_height = " fill_parent "
 >
            

                                   <LinearLayout
 android :id = "@ + id / webMainLayout"
 android :layout_width = "match_parent"
 android :layout_height = "60dp"
 android :padding = "@ dimen / size_10dp"
 android :orientation = "horizo​​ntal"
 android :layout_alignParentTop = "true "
 android :gravity = " right "
 android :background = "#00000000 "
 >
         <TextView
 android :layout_width = " match_parent "
 android :layout_height = " match_parent "
android :gravity =                                                                                                            "center"
 android :text = "目前所在地北京"
 android :textSize = "15sp"
 android :layout_marginLeft = "@ dimen / size_15dp"
 android :textColor = "@ color / color_chat_send_status" >
         </ TextView>
         <ImageButton
 android :layout_width = "@ dimen / size_50dip"
 android :layout_height = "@ dimen / size_50dip"
 android :src = "@ mipmap / head"
 android :layout_gravity = "center"
 > </ ImageButton>
     </ LinearLayout>
                                                                                                            

</ RelativeLayout>

コントロールのレベルとレイアウトの順序も関連しています

20件のオリジナル記事を公開 Likes2 10,000以上の訪問数

おすすめ

転載: blog.csdn.net/qq_28335347/article/details/66476904