我希望我的卡片看起来像下面这样
我保留了我的布局
<android.support.v7.widget.CardView
android:layout_gravity="center"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
card_view:cardCornerRadius="2dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Order# GAMH2103"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:gravity="start"
android:textSize="15dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Confirmed"
android:drawableRight="@drawable/check"
android:textColor="#00FF00"
android:gravity="end"
android:textSize="15dp"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@android:color/darker_gray"
android:layout_marginTop="5dp"
/>
</LinearLayout>
不知何故,我无法将“已确认”文本视图显示出来。 我可以看到订单号。
我尝试过调整 gravity
和 layout_gravity
但总是不成功。
请帮帮我。
谢谢,Lakshman。
android:layout_width="match_parent"
,所以“confirmed” TextView无法显示。请更改为android:layout_width="wrap_content"
。如果您希望“confirmed” TextView始终可见,则可以添加android:layout_weight="1"
。 - Hoang Nguyen