我在CardView中有一个TextView和一个ImageView。
我有一个TextView的问题。
当TextView文本长于CardView长度时,它显示在ImageView上,我不希望这样。在textView旁边添加ImageView在同一行中
喜欢这幅画:
我想它,以便当文本触及ImageIiew,它显示...
用于指示文本延续。
row.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_margin="4dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/txt_file_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_delete_forever_red_500_24dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
</android.support.v7.widget.CardView>
这是我想要的屏幕截图:
尝试添加drawableleft(把绘制的图像),并把填充drawablepadding你的TextView –
节目截图中,你想要什么。 – Ironman
@Ironman我从我的目标添加屏幕截图。 –