Осмотрев ваши комментарии у меня есть лучшее понимание того, что вы пытаетесь достичь. Это использует дополнительный просмотр, но позволяет группировать текстовое изображение в виде изображения.
RelativeLayout в верхнем левом углу:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<!-- place this layout anywhere and the imageview and textview will follow. -->
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageView1"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:text="TextViewTextViewTextViewTextViewTextView" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
</RelativeLayout>
RelativeLayout в центре экрана:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<!-- place this layout anywhere and the imageview and textview will follow. -->
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageView1"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:text="TextViewTextViewTextViewTextViewTextView" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
</RelativeLayout>
RelativeLayout в нижнем правом углу:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<!-- place this layout anywhere and the imageview and textview will follow. -->
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageView1"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:text="TextViewTextViewTextViewTextViewTextView" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
</RelativeLayout>
Как вы можете видеть в любом месте вы помещаете внутренний RelativeLayout в ImageView и TextView.
Спасибо, но это не сработало – Snake
Прочитав то, что вы ищете, я переписал свой ответ. –
Спасибо, но этот Относительный взгляд фиксирует расположение в верхнем левом углу экрана. Я не хочу этого так – Snake