2017-02-17 78 views
0

在我的小部件佈局文件中,我設置了textview文本大小,並且所有內容都適合小部件。當我在較小的手機(320x480)上發佈時,很多文本被切斷,並且在小部件上不可見。我如何解釋更小的手機尺寸並定義更小的文本視圖尺寸?Android小部件小屏幕的Textview大小

+0

發佈您的代碼,這樣我們就可以瞭解自己的錯誤或問題:給出一個解決方案 –

+0

嘗試使用不同尺寸不同的手機屏幕大小,您的問題將得到解決。 –

回答

0

您應該使用夢詩TEXTSIZE基於手機的屏幕大小進行設置。

enter image description here

查找範圍中上述圖像I製成4個夢詩對於不同的屏幕尺寸。 在維度(w820dp)我寫了下面的代碼。

<resources> 
<!--include 7" and 10" devices --> 
<dimen name="activity_horizontal_margin">64dp</dimen> 
<dimen name="item_image_size">60dp</dimen> 
</resources> 

在dimens.xml(sw600dp)中,我按照需求編寫了以下代碼。

<resources> 
<!-- For 7」 tablets (600dp wide and bigger) --> 
<dimen name="activity_horizontal_margin">16dp</dimen> 
<dimen name="item_image_size">54dp</dimen> 
</resources> 
0

請參閱本answer和 添加

android:maxWidth="size" //size- the number more than 1 

這在你的TextView佈局