In my widget layout file, I have set textview text sizes and all my content fits inside the widget. When I launched on a smaller phone (320x480) a lot of the text was cut off and was not visible on the widget. How can I account for smaller phone sizes and define smaller textview sizes?
Asked
Active
Viewed 161 times
0
-
post your code, so that we can understand your mistake or issue & give a solution – Vignesh Sundaramoorthy Feb 17 '17 at 04:31
-
try to use different dimensions for different mobile screen size, and your problem would be solved. – Pankaj Lilan Feb 17 '17 at 04:53
2 Answers
0
Refer this answer and add
android:maxWidth="size" //size- the number more than 1
this in your textview layout

Community
- 1
- 1

Kiran Benny Joseph
- 6,755
- 4
- 38
- 57
0
You should use dimens to set textsize based on phone's screensize.
Look in above image I made 4 dimens for different screen sizes. In dimens(w820dp) I wrote following code.
<resources>
<!--include 7" and 10" devices -->
<dimen name="activity_horizontal_margin">64dp</dimen>
<dimen name="item_image_size">60dp</dimen>
</resources>
While in dimens.xml(sw600dp) I wrote following code as per requirements.
<resources>
<!-- For 7” tablets (600dp wide and bigger) -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="item_image_size">54dp</dimen>
</resources>

Sunil Parmar
- 1,223
- 1
- 13
- 22