2

你能告诉我如何像这样对齐textViewimageview

 _____
|     |
|_____| Some Dummy text,Some Dummy text,
Some Dummy text,Some Dummy text,S...more 

我只想将我的 TextView 限制为 2 行,最后我将调用一个 TextView 或 Button 以获取更多将在弹出窗口中打开的文本。

有没有可能创造出这样的东西。?

4

3 回答 3

0
 <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>
于 2012-07-19T09:32:35.210 回答
0

这绝对是可能的。您需要使用 RelativeLayout,您可以在其中放置每个视图并根据需要对齐它们。

于 2012-07-19T09:02:59.507 回答
0

这对我有用,请看一下: http: //gmariotti.blogspot.co.uk/2014/03/snippet-align-textview-around-image.html

于 2016-04-20T13:12:21.953 回答