I am new to android programming. I am trying to create a basic clock app. I have found the textClock function and have been trying to implement it such that the clock digits stretch to the width of the screen or parent view. Right now when I put in a text clock and define a textSize, the clock looks huge on a nexus 4 and small on a nexus 10.
How to I make the clock stretch to the screen width?
Any help is appreciated. If you provide code, please explain it in detail. Thank you in advance!
you can do this by changing font size dynamically.
you should create a custom widget for it.
here is a very helpful link that shows you how to do this!
TextClock is a widget that extends
TextView
. you should create your ownTextClock
for your purpose. in above link, there is sample code for a custom widget that you want.