[英]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.