0
Good morning, I’m looking to create a layout like Google Play, but I’m not sure how to design it. Could help me?
https://i.stack.Imgur.com/Xw2wt.jpg
Link to the XML code
https://pastebin.com/sNytLsNz
0
Good morning, I’m looking to create a layout like Google Play, but I’m not sure how to design it. Could help me?
https://i.stack.Imgur.com/Xw2wt.jpg
Link to the XML code
https://pastebin.com/sNytLsNz
1
The problem is you didn’t define a child
main to the cardview. This Child, who will be a viewgroup
will organize all other views within the cardview arriving at the result you want.
<android.support.v7.widget.CardView
android:id="@+id/cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="50dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/ads_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Melhores preços" />
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_ads"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="40dp"
android:scrollbars="none" />
</LinearLayout>
</android.support.v7.widget.CardView>
Thanks, solved my problem!
Browser other questions tagged android android-layout android-recyclerview
You are not signed in. Login or sign up in order to post.
Same way in which?!
– viana