Whenever I turn the device sideways, everything in my app also turns and becomes distorted. How do I lock it into vertical?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
For the activity you have defined in the manifest, you need to set the
android:screenOrientation
.Set it to
portrait
orlandscape
. Make sure it is notsensor
.Take a look at these SOqs:
In your
AndroidManifest.xml
set the orientation on your Activity toportrait
like this.Generally, you do not want to do that.
First, some users have devices with physical keyboards that only operate in landscape mode. Perhaps, for your app, that does not matter. However, any app that uses text input should support landscape mode for these users.
Second, few TVs will operate in portrait mode. It is reasonably likely that your app will look bad on Google TV when it starts supporting Android applications.
Third, even for users whose devices are not forcing them to use landscape, simply prefer to use landscape, for whatever reason.
All of these user bases will think less of applications that force portrait mode, and their opinions may be reflected in ratings on the Android Market.
Most applications should support portrait and landscape, through careful design of the existing layouts and by using
res/layout-land/
to provide replacement layouts where a significant change is required.