TonicArtos / StickyGridHeaders

This project has been superseded by SuperSLiM, a layout manager for RecyclerView. I strongly recommend using SuperSLiM and not StickyGridHeaders.
http://tonicartos.com
Apache License 2.0
1.47k stars 442 forks source link

Layout width issue #102

Closed drhr closed 6 years ago

drhr commented 10 years ago

The simple layout below is being collapsed. The second text view should expand to the full remaining width of the container and the text be right-aligned. Instead, the text field shrinks to fit its text.

Something similar happens if I switch this all to a RelativeLayout using alignParentRight on that text field - this property gets ignored and the two text fields overlap.

Layout editor shows this: screen shot 2014-09-03 at 11 08 20 am

Device shows this: screen shot 2014-09-03 at 11 06 51 am

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:background="#ffffeeaa"
          android:layout_width="match_parent"
          android:layout_height="match_parent">

<TextView
        android:id="@+id/txt_header"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#ff242424"
        android:layout_marginTop="15dp"
        android:layout_marginBottom="15dp"
        android:textSize="20dp"
        android:text="test" />

<TextView
        android:id="@+id/txt_tip"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginRight="15dp"
        android:layout_marginTop="15dp"
        android:layout_marginBottom="15dp"
        android:background="#ffddeeff"
        android:gravity="right"
        android:textSize="15dp"
        android:text="test"
        android:textStyle="italic"
        android:textColor="#97242424" />

</LinearLayout>
drhr commented 10 years ago

See the above PR. Seems to work. My layout shows up as designed:

screen shot 2014-09-03 at 12 19 41 pm