jatin rana
jatin rana

Reputation: 835

Textview fill available width

i have two textviews in relative layout. first textview size is fixed and second textview size is dynamic. I want my second textview to fill all available width want output like thisbut i am unable to do this. is it possible? this is what i am getting right now

My xml :

 <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/ten_dp">

        <com.staff_have_says.utitlies.MyTextViewBold
            android:id="@+id/banner"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Massage To Management"
            android:background="@android:color/holo_green_dark"
            android:padding="@dimen/ten_dp"
            android:textColor="@color/white"
         />

        <TextView

            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toEndOf="@id/banner"
            android:text="Flaticon Basic License. It's necessary to credit the author.  How to credit the authorship of the icons?Flaticon Basic License. It's necessary to credit the author.  How to credit the authorship of the icons?"

            />
    </RelativeLayout>

Upvotes: 0

Views: 563

Answers (1)

pawegio
pawegio

Reputation: 1732

You can use a single TextView for both sections of your content with SpannableString as a text. See example.

Upvotes: 2

Related Questions