Question

I have a layout with RelativeLayout as parent and a child TextView

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
   <TextView
     android:text="Test Include"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/>
 </RelativeLayout>

This layout is included into another RelativeLayout.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
   <include layout="@layout/include_me"
         android:layout_alignParentBottom="true"
    android:layout_marginTop="10dp"/>
 </RelativeLayout>

Issue: I am trying to change the attribute values of the included layout. But android:layout_alignParentBottom="true" or android:layout_marginTop="10dp" doesn't make any effect.

Does that changing the attribute values in include has no effect?

Was it helpful?

Solution

try adding also android:layout_width and android:layout_height to the <include tag

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top