Hi, I'm reworking some of my layouts to use Relative layout. I have
some building blocks which i'd like to reuse.
The problem i seems to have with the include of the layout and
position other layouts out of this include. Example:

<RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android";
        android:layout_width="fill_parent"
        android:layout_height=wrap_content"
>
        <include
                layout="@layout/gradient_separater"
                android:layout_alignParentTop="true"
                android:layout_below="@id/story_position_container" />
        <com.my.ContentLayout
                android:layout_below="@id/gradient_separater"
                android:id="@+id/story_layout"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent" />

</RelativeLayout>

doesnt work in terms that ContentLayout is not getting positioned
below first layout. However if i move my include code to the layout
itself like this

<RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android";
        android:layout_width="fill_parent"
        android:layout_height=wrap_content"
>
   <ImageView
                android:id="@+id/gradient_separater"
               android:layout_alignParentTop="true"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:src="@android:drawable/divider_horizontal_bright" />
        <com.my.ContentLayout
                android:layout_below="@id/gradient_separater"
                android:id="@+id/story_layout"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent" />

</RelativeLayout>
Everything seems to work. I've tried to overwrite the id attribute on
include - didn't really help. Also it seems putting attributes like
android:layout_marginTop doesnt affect layouts that added via include.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to