简体   繁体   中英

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

I worked in a tabactivity, I set the gravity for tabs as bottom. If I change the screen 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM