简体   繁体   English

Android - 将标签锁定为纵向

[英]Android - Locking tabs to portrait orientation

I am writing an Android app with three tabs, two designed in portrait mode, and one (a mini-spreadsheet) in landscape mode.我正在编写一个 Android 应用程序,其中包含三个选项卡,两个以纵向模式设计,一个(迷你电子表格)以横向模式设计。 The issue is with the function of the tab-set.问题出在标签集的 function 上。 When I set the orientation in the landscape tab, the tabs themselves move over and take up the top of the screen.当我在横向选项卡中设置方向时,选项卡本身会移动并占据屏幕顶部。 This takes up a large portion of the screen space, and is confusing to the user.这占用了很大一部分屏幕空间,并且使用户感到困惑。

Here is my questions: How do I lock the tabs themselves in place, so they stay in the same position when in landscape mode;这是我的问题:如何将标签本身锁定到位,以便在横向模式下它们保持在相同的 position 中; in landscape mode this would be the left side of the screen.在横向模式下,这将是屏幕的左侧。

Another way of approaching the question: Is there a way to rotate a layout inside of a tab without effecting the entire tab-set?解决问题的另一种方法:有没有办法在不影响整个选项卡集的情况下旋转选项卡内的布局?

in the manifest under the tab activity, put android:screenOrientation="portrait"在选项卡活动下的清单中,将 android:screenOrientation="portrait"

I found a solution outside of the tab-set.我在选项卡集之外找到了一个解决方案。 The following link discusses multiple solutions for displaying Vertical text:以下链接讨论了显示垂直文本的多种解决方案:

Vertical (rotated) label in Android 垂直(旋转)label Android

I went with "CustomTextView" by PocketMagic which can be found here: http://www.pocketmagic.net/?p=1625我选择了 PocketMagic 的“CustomTextView”,可以在这里找到: http://www.pocketmagic.net/?p=1625

With the ability to display vertical text, I can keep the entire tab-set locked in Portrait mode.通过显示垂直文本的能力,我可以将整个选项卡集锁定在纵向模式。

Thanks for the suggestions everyone.谢谢大家的建议。

-cc -cc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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