sha*_*ala 1 android overflow textview
我正在创建一个图像库(带有视图翻转器),其中 viewflipper 的每个视图都有一个图像视图和它下面的两个文本视图。我想要的是根据图像视图宽度调整这些文本视图的宽度。这些 imageview 和 text 是动态添加到 viewflipper 中的,因此无法在 xml 中调整宽度。此外,图像的宽度每次都不同(一些纵向,一些横向)。谷歌搜索没有帮助。所以这就是我想要的。任何帮助,将不胜感激。
小智 5
试试这个,它可能会帮助你
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:src="your image" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/imageView"
android:layout_alignRight="@+id/imageView"
android:layout_below="@+id/imageView"
android:layout_marginTop="16dp"
android:text="I am creating sort of an image gallery (with view flipper) wherein each view of viewflipper has an imageview and two textviews below it. " />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3358 次 |
| 最近记录: |