Answer the question
In order to leave comments, you need to log in
How to assign a layout'a background?
Good afternoon. The problem is this: there is a layout. It needs to adjust to the size of the content. Parameters width\height cost wrap_content. But here's the problem: when I put a background on it, the layout itself stretches to the maximum width. How can this be fixed? code and screenshot below
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/oblakol"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerInParent="true"
>
<TextView
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
</FrameLayout>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question