[英]How to align TextView around ImageView with fixed line of text
你能告诉我如何像这样在imageview
周围对齐textView
_____
| |
|_____| Some Dummy text,Some Dummy text,
Some Dummy text,Some Dummy text,S...more
我只想将TextView限制为2行,最后我将有一个TextView或Button调用更多,以获取更多文本,这些文本将在弹出窗口中打开。
是否可以创建这样的东西?
绝对有可能。 您需要使用RelativeLayout,可以在其中放置每个视图并根据需要对齐它们。
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:src="@drawable/pic7"
android:text="image1" />
<TextView
android:id="@+id/text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Textview1" />
</LinearLayout>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.