简体   繁体   中英

What is the parent of the linear layout in my code?

This is my code currently

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

   <EditText android:id="@+id/edit_message"
       android:layout_weight = "1"
       android:layout_width = "0dp"
       android:layout_height= "wrap_content"
       android:hint = "@string/edit_message" />
   <Button
       android:layout_width = "wrap_content"
       android:layout_height= "wrap_content"
       android:text = "@string/submit"
       android:onClick = "sendMessage"  />


</LinearLayout>

I researched the term match_parent and found it to be to match "size of parent layout"(Src: http://www.simplecodestuffs.com/difference-between-wrap-content-and-fill-parentmatch-parent/ )

For a button if i specify match_parent, i know the parent would be the linear layout. My question if i specify match_parent on the linear layout, what parent would it match? What would be the term for that parent?

该LinearLayout的父级可以是一个活动(因此LinearLayout将与设备的屏幕一样大),也可以是片段,列表/网格项等。基本上,您在其中包括布局的任何视图组。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM