Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple text lines on a button. Each line has different text styles

Tags:

android

button

Hi i'm trying to create a button with multiple lines of text. See below example. Each line of text has a different text size and colour applied to it. The button also needs to be able to send the user to the next page. Is this possible in XML? I've looked everywhere and can't find a solution. Thanks.

BUTTON HEADING TEXT(large green font) 1st button text (small grey font) 2st button text (small white font)

See example:

enter image description here

like image 403
mjwals Avatar asked Dec 01 '22 23:12

mjwals


1 Answers

Picture is not accessible. but according to your problem, you can implement a LinearLayout as main componenet and set its property clickable and focusable, and set its background to android.R.drawable.btn_default. Set orientation of this layout to Vetical.

Add as many TextViews of any style in this linearlayout in xml or dynamically as you want. But set all the TextViews focusable and Clickable property to false.

like image 55
jeet Avatar answered Dec 18 '22 22:12

jeet