listPreferredItemHeightSmall在api 16上不起作用
问题描述:
我正在使用下面的代码,它在api 23上工作正常,但在api 16(Jelly Bean)上的其他设备上却无法正常工作.
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 name="NavigationViewStyle">
<item name="android:textSize">20sp</item> <!-- menu item text size-->
<item name="android:listPreferredItemHeightSmall">40dp</item><!-- menu item height-->
</style>
然后使用app:theme
<android.support.design.widget.NavigationView
...
...
app:theme="@style/NavigationViewStyle"
...
...
</android.support.design.widget.NavigationView>
答
对于较早的版本,应使用不带"android" nameSpace的"android:listPreferredItemHeightSmall"
.
You should use "android:listPreferredItemHeightSmall"
without "android" nameSpace for older versions.