Skip to content

Instantly share code, notes, and snippets.

@squm
Created January 28, 2013 08:40
Show Gist options
  • Save squm/4653957 to your computer and use it in GitHub Desktop.
Save squm/4653957 to your computer and use it in GitHub Desktop.
how to put text to the right of image ?
<LinearLayout 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"
android:orientation="vertical"
tools:context=".MainActivity" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/hello_world"
android:scaleType="fitStart"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/hello_world"
android:scaleType="fitStart"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/hello_world"
android:scaleType="fitStart"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment