How could I implement a button background for ImageButton or Button which contains 2 textview each using different font sizes ? I cant use static images as background and I need to achieve this either using xml or programmatically.
This is a numeric keypad and it carries a numeric value and a set of alphabets each of which uses different font sizes and needs to be set as button text.
Here are some of the suggestions that pop-up on my brain but seems to have limitations since I want to reuse the UI component and avoid code repetition.
Create a layout xml containing 2 textfields and set that as background on the button. But how can I get a reference of these textview fields to set the value on them in the MyActivity.java?
Use a layeredlist ? still same problem reference of textviews
Or create a custom view and inflate layout mentioned in step 1. This solution resolves my problem.
Does any other solution exist for this UI requirement?
Thanks.