0
我想在android中创建如下所示的UI。 如何在android中实现以下显示效果textview
在上面我们可以看到textview over imageview我使用了framelayout。 但我的问题是我如何实现如下所示的textview,即如果textview 文本超过那么...显示。如何在textview中实现这种效果。
我的XML代码如下所示
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<ImageView
android:id="@+id/grid_img"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:scaleType="fitXY"
android:src="@drawable/nature1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello"
android:inputType="textMultiLine"
android:layout_gravity="bottom"
/>
</FrameLayout>
+1与ellipsize –
我试过,但它不工作我没有得到同意... ..在文本结束后。 感谢您的回复。 –
只有当文本大于TextView时才会得到'...' –