2017-06-20 98 views
2

我模糊的TextView與代碼的Android TextView的模糊奇怪

rowTitle.setText("Some"); 
    rowTitle2.setText("(City)"); 
    //rowTitle.setText("Some title"); 
    //rowTitle2.setText("(City)"); 

    radius = rowTitle.getTextSize()/3; 
    filter = new BlurMaskFilter(radius, BlurMaskFilter.Blur.NORMAL); 
    rowTitle.setLayerType(View.LAYER_TYPE_HARDWARE, null); 
    rowTitle.getPaint().setMaskFilter(filter); 

對於文本 「一些」 enter image description here

對於文本 「有些標題是」 enter image description here

  1. 爲什麼模糊不是所有文字(圖片1和圖片2)?
  2. 爲什麼模糊第二個TextView(圖片2)?
+0

@IntelliJAmiya隨着LAYER_TYPE_SOFTWARE文本沒有顯示出良好的工作。可能是因爲我使用android:hardwareAccelerated =「true」 –

回答

0

所有,如果除去

<TextView 
    android:textAppearance="?android:textAppearanceMedium" 
/>