Answer the question
In order to leave comments, you need to log in
How to correctly fill the background with a picture in Andoid?
I'm trying to make such a title bar. Right now it's organized like this: LinearLayout with a background that is a bitmap.
Layout piece:
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:id="@+id/linearLayout"
android:background="@drawable/header_bg"
android:gravity="center_horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="ЗАКАЗ ТАКСИ"
android:id="@+id/textView5"
android:background="#f9d25e"
android:gravity="center_vertical|center_horizontal"
android:textStyle="bold"
android:textColor="#000"
android:textSize="20sp"
android:paddingLeft="10dp"
android:paddingRight="10dp" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/header_app"
android:tileMode="repeat"
android:dither="true" />
Answer the question
In order to leave comments, you need to log in
There was a similar task, I would transfer the checkered background to 9patch developer.android.com/tools/help/draw9patch.html
you then get rid of android:tileMode="repeat"
and you need to look at what resolution your picture,
developer.android. com/guide/practices/screens_supp...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question