Z
Z
ZAndrew2015-09-08 09:29:18
Android
ZAndrew, 2015-09-08 09:29:18

Button with custom background. How to prepare for all screen sizes?

I got confused in the process of studying the issue of creating a button with a picture as background. Did I understand correctly that for each drawable-xxxxxx folder you need to create your own version of the image size? Or/and is it possible to use some magical attributes in the Button tag? Or just write layout_width, height in dp? And where does the 9-patch? I would be grateful for a link to a quality tutorial.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Chvalov, 2015-09-08
@Chvalov

For you: Create a custom button using 9-patch and state list
and Android nine-patch - stretch android
And look here for answers: using nine-patch image as Background of Button android

O
Oleg Gamega, 2015-09-08
@gadfi

Did I understand correctly that for each drawable-xxxxxx folder you need to create your own version of the image size?

Yes
the picture can stretch and contain content, that is, certain parts where there should be an inscription should stretch, but for example corners should not
stretch generator)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question