Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Header View children cannot be resized #7

Closed
nathanielwolf opened this issue Oct 30, 2014 · 2 comments
Closed

Header View children cannot be resized #7

nathanielwolf opened this issue Oct 30, 2014 · 2 comments
Assignees
Labels
Milestone

Comments

@nathanielwolf
Copy link

Any children with width=wrap_content have a size fixed at inflation, even when content is added to them. e.g. a TextView. Calling requestLayout or setLayoutParams with a fixed width also has no effect.

@leruaa leruaa added the bug label Oct 30, 2014
@leruaa leruaa added this to the v0.4.2 milestone Oct 30, 2014
@leruaa leruaa self-assigned this Oct 30, 2014
@leruaa
Copy link
Member

leruaa commented Oct 30, 2014

Hi,

Can you post an example of a header layout that fail ?

@nathanielwolf
Copy link
Author

The layout below is from your sample, but with the title TextView width to wrap_content. I also made the background red so I could see that view - it has a width of 0dp so it is not visible.

top_header.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:paddingStart="@dimen/item_padding"
    android:paddingEnd="@dimen/item_padding">

    <TextView
        android:id="@+id/title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="left|center_vertical"
        android:textAppearance="?android:textAppearanceMedium"
        android:background="#F00"/>

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:src="?android:listDivider"
        android:scaleType="fitXY"/>
</LinearLayout>

@leruaa leruaa closed this as completed in a82f2f3 Nov 2, 2014
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants