AmitCharkha
AmitCharkha

Reputation: 259

How to set textview side by side of image view

** How to achieve this view? I can able to show text on right side. how to show it right side and  below image view.**

**How to achieve this view? I can able to show text on right side. How to show it on right side and below image view? It is TextView contains description. So, text can be of one line or 10 lines.

Please Help!!!**

Upvotes: 0

Views: 705

Answers (3)

bhagyawant biradar
bhagyawant biradar

Reputation: 215

WebView would be best for this.. Add image view in web and text filling the webview

Upvotes: 0

Hoven
Hoven

Reputation: 573

You can use this:

editText.setCompoundDrawables(getResources().getDrawable(R.drawable.your_image), null, null, null);

Similar question

Upvotes: 0

Sarfaraz
Sarfaraz

Reputation: 345

Use the following layout

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="0.6">

        <ImageView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1" />

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical">

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:text="Hello" />

        </LinearLayout>
    </LinearLayout>
    <TextView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="0.4"/>
</LinearLayout>

Upvotes: 1

Related Questions