Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will <include> override the layout_width/layout_height value?

Tags:

android

I have a layout xml file named my_layout.xml, in which the root view's layout_width and layout_height has been specified as 200px.

<com.jlee.demo.MyLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="horizontal"
     android:layout_width="200px"
     android:layout_height="200px">

If I used this xml to be included in another xml, and specify the layout_width and layout_height as 100px.

<include layout="@layout/my_layout"
     android:layout_width="100px"
     android:layout_height="100px"/>

What would be the real width/height of my_layout?

like image 642
Johnny Avatar asked May 10 '10 08:05

Johnny


1 Answers

the top voted answer in this question should help you:

Does Android XML Layout's 'include' Tag Really Work?

you can only override parameters which start with layout_. so in your case, the layout should be 100*100.

like image 162
RoflcoptrException Avatar answered Oct 01 '22 18:10

RoflcoptrException