【发布时间】:2018-03-08 13:05:03
【问题描述】:
我有这样的屏幕要求:
但我不能让它像那样工作。我最终制作了这样的视图:
我正在使用 CardView。列表内容正在动态扩展。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/lblProductName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="19dp"
android:padding="10dp"
android:text="Product Name"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/lblProductQuantity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="19dp"
android:padding="10dp"
android:text="99"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
如何使我的屏幕看起来与所需的屏幕相同?
【问题讨论】:
-
发布您的代码
-
显示你的 XML 。
-
@KingofMasses 我已经编辑了我的帖子并包含了我的 xml。