Autosizing TextViews in RecyclerView causes text size to decrease

后端 未结 6 844
野趣味
野趣味 2021-02-13 17:24

I am trying to use Autosizing TextViews in a RecyclerView, but when I scroll a few times the text gets so small that it\'s obviously not working properly.

Example of my

6条回答
  •  旧巷少年郎
    2021-02-13 17:52

    Autosizing TextViews

    Android 8.0 (API level 26) allows you to instruct a TextView to let the text size expand or contract automatically to fill its layout based on the TextView's characteristics and boundaries.

    Note: If you set autosizing in an XML file, it is not recommended to use the value "wrap_content" for the layout_width or layout_height attributes of a TextView. It may produce unexpected results.

    You should bound height

     android:layout_height="30dp"
    

提交回复
热议问题