开发者

how to track the screen in landscape or portrait view in android?

开发者 https://www.devze.com 2022-12-20 20:51 出处:网络
I worked in a tabactivity, I set the gravity for tabs as bottom. If I change the s开发者_如何学Gocreen from portrait to landscape, I can\'t see the tabs.

I worked in a tabactivity, I set the gravity for tabs as bottom. If I change the s开发者_如何学Gocreen from portrait to landscape, I can't see the tabs.

How can I do it? I need an example please.

Thanks.


Assuming you do not have a separate XML file dedicated to landscape format, you might need to create one and specify the landscape-layout look.

Create another main.xml file with the specifics of how your program should look in landscape mode. The file shoud reside inside your res/layout-land/ folder.

When that is all said and done, in potrait orientation, Android will use main.xml found in res/layout and in landscape main.xml found in res/layout-land.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号