listPreferredItemHeightSmall is not working on api 16

╄→尐↘猪︶ㄣ 提交于 2019-12-22 14:05:41

问题


I am using the code below and it's working fine on api 23 but not on another device on api 16(Jelly Bean) .

Style:

<style name="NavigationViewStyle">
     <item name="android:textSize">20sp</item> <!-- menu item text size-->
     <item name="android:listPreferredItemHeightSmall">40dp</item><!-- menu item height-->
</style>

And then, apply this style to NavigationView using app:theme

<android.support.design.widget.NavigationView
       ...
       ...    
        app:theme="@style/NavigationViewStyle"
       ...
       ...


</android.support.design.widget.NavigationView>

回答1:


You should use "android:listPreferredItemHeightSmall" without "android" nameSpace for older versions.



来源:https://stackoverflow.com/questions/35453698/listpreferreditemheightsmall-is-not-working-on-api-16

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!