Custom layout inside adapter
See original GitHub issueI’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>
Output
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)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Changing Layout file on custom adapter depending on activity ...
The only thing that needs changing is the layout file. This is my custom adapter: package com.example.placesofinterest; ...
Read more >Android ListView with Custom Adapter Example Tutorial
In this tutorial we'll use a CustomAdapter that populates the custom rows of the Android ListView with an ArrayList .
Read more >Custom Adapters with RecyclerView
Adapter requires a ViewHolder . A ViewHolder is an object that stores multiple Views inside the tag field of the Layout so they...
Read more >How to create custom RecyclerView adapter with multiple ...
Before attaching a Custom Adapter to the RecyclerView, make sure you have included the RecyclerView view tags in the layout (xml) file.
Read more >View Binding in RecyclerView with Custom Adapter in Android ...
Feel Free To Contact Us Here http://www.aaviskar.com/support.phpThis video shows how to use view binding in adapter android.you ma...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, Can you explain, how you have solved your issue ?
@The-RobinHood can u please tell us, how u solved the issue ?