Android view smoothing

As you can see in the screenshot below, the "title" gets these ugly stripes in all areas with text that extends the entire width of the screen. This is even more noticeable on a real device.

Is there any way around this?

activity

+3
source share
2 answers

From Android Developers: Widget Design Guide :

In some cases, devices have a low depth pixel, which can cause visual binding and smoothing problems. To solve this problem, application developers must go through an asset through a "proxy" defined as XML :. This method links to original works of art, in this case "background.9.png", and instructs the device to smooth it as needed.

EDIT: An example of a source. This is the xml file in the res/drawables :

 <?xml version="1.0" encoding="UTF-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/title_bar_medium" android:dither="true" /> 
+7
source

Add android:tileMode="repeat" to this code, for example:

 <?xml version="1.0" encoding="UTF-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/b1" android:tileMode="repeat" android:dither="true" /> 

The reason is that on some devices it still stretches the image and looks pretty bad, check this Link here

0
source

Source: https://habr.com/ru/post/1386998/


All Articles