我在清单中给android:configChanges="orientation|keyboard"
了我的活动,当我旋转我的设备时,onConfigurationChanged
总是被调用。没问题。
我想要的是当设备旋转时,小部件的字体大小会改变。
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/my_font_size" />
和上面一样,textSize
属性引用资源中的值,定义的 xml 文件my_font_size
位于 values-land、values-port 文件夹中。
好的。我准备好了。构建它,运行它,然后旋转设备,没有任何变化。onConfigurationChanged() 中的 requestLayout() 不起作用。有什么建议吗?
谢谢。