Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Custom layout inside adapter #21

Open
The-RobinHood opened this issue Apr 19, 2016 · 6 comments
Open

Custom layout inside adapter #21

The-RobinHood opened this issue Apr 19, 2016 · 6 comments

Comments

@The-RobinHood
Copy link

The-RobinHood commented Apr 19, 2016

I'm trying to add custom layout but getting weird output.

raw.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center"
    android:background="@android:color/darker_gray">
    <ImageView
        android:id="@+id/imageview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:text="test"
        android:textColor="@android:color/black" />
</FrameLayout>

Adapter code

Output
aaaa

Image are not display as per aspect ratio, can you please shade the light that where I'm lacking.

This is how It should look (It is created with dynamic imageview but I need to generate view via xml)
bbb

@JVillella
Copy link
Contributor

The xml layout above, is that what you are using as recycler view items? If so, is this a duplicate of this #16?

@The-RobinHood
Copy link
Author

ooh, but I think OP doesn't clarify exact logic to achieve? will you please update the library?

thanks

@MickaelRomaniello
Copy link

Hi, I have the same problem. Do you have found something ?

@The-RobinHood
Copy link
Author

Hello I solved my issue. thanks guys..cheers

@MickaelRomaniello
Copy link

Hi,
Can you explain, how you have solved your issue ?

@abhimuktheeswarar
Copy link

@The-RobinHood can u please tell us, how u solved the issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants