2017-08-23 33 views
0

當我在GestureFrameLayouthttps://github.com/alexvasilkov/GestureViews)中放大足夠遠的距離時,TextView中的文本變形。放大嵌入在GestureFrameLayout中的TextView中的變形文本

有沒有辦法解決這個顯示錯誤? (見下文GIF)

enter image description here 以下是用於

<com.alexvasilkov.gestures.views.GestureFrameLayout 
    android:id="@+id/ll_gesture" 
    android:layout_width="0dp" 
    android:layout_height="0dp" 
    android:layout_gravity="center" 
    android:gravity="center" 
    app:layout_constraintBottom_toBottomOf="parent" 
    app:layout_constraintLeft_toLeftOf="parent" 
    app:layout_constraintRight_toRightOf="parent" 
    app:layout_constraintTop_toBottomOf="@+id/font_name"> 

    <TextView 
     android:id="@+id/tv_text" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:textColor="@color/black" 
     android:textSize="40sp" /> 

</com.alexvasilkov.gestures.views.GestureFrameLayout> 

回答

0

的XML我找到了解決問題的辦法在這裏。

https://stackoverflow.com/a/12371794/908821

這顯然是一個硬件加速的錯誤/問題。

要解決它,我不得不在我的xml中添加android:layerType =「software」。

<com.alexvasilkov.gestures.views.GestureFrameLayout 
     android:id="@+id/ll_gesture" 
     android:layout_width="0dp" 
     android:layout_height="0dp" 
     android:layout_gravity="center" 
     android:gravity="center" 
     app:layout_constraintBottom_toBottomOf="parent" 
     app:layout_constraintLeft_toLeftOf="parent" 
     app:layout_constraintRight_toRightOf="parent" 
     app:layout_constraintTop_toBottomOf="@+id/font_name"> 

     <TextView 
      android:id="@+id/tv_text" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:textColor="@color/black" 
      android:layerType="software" 
      android:textSize="40sp" /> 

</com.alexvasilkov.gestures.views.GestureFrameLayout> 
相關問題