我通过指定 android:configChanges="orientation|keyboardHidden" 锁定屏幕方向,
将文本设置为文本视图并将其添加到自定义视图组。更改方向时,我会更改文本视图的宽度和高度。
当我运行应用程序时,如果屏幕处于横向,则文本为单行,如果屏幕为纵向,则文本为两行。因此有足够的空间在两个方向上显示文本。
但是,当我将方向从横向更改为纵向时,文本不会换行,我只能看到一部分。如果我将方向从纵向更改为横向,文本将显示为两行并且不会被拉伸。
我是否想在 onConfigurationChanged() 方法中执行任何操作???
请帮帮我。谢谢。
im locking the screen orientation by specifying android:configChanges="orientation|keyboardHidden"
im setting a text to a textview and adding it to a custom viewgroup. when changing the orientation im changing the width and height of the textview.
when Im running the application, if I have the screen in landscape, the text is in single line and if in portrait, the text is in two lines. so there is enough space to display the text in both orientations.
But when I change the orientation from Landscape to portrait, the text is not wrapping and I can see only a part. If I change the orientation from portrait to landscape, the text was getting displayed in two lines and not getting stretched.
Whether I want to do anything in onConfigurationChanged() Method????
Please help me out. Thank you.
发布评论