简体   繁体   English

如何在同一设备上以相同尺寸设计多个屏幕

[英]How to design multiple screens on the same device, same size

Just started with Android programming. 刚开始使用Android编程。 Working on a scoreboard for a card game for my 10 inch tablet. 为我的10英寸平板电脑打牌时在计分板上工作。 I'm not looking for screen set up for different sizes, but working with different screens(views) on the same device. 我不是在为不同的尺寸设置屏幕,而是在同一设备上使用不同的屏幕(视图)。 My screen has 4 parts with each a number of views (textview, button): 我的屏幕分为4个部分,每个部分都有许多视图(文本视图,按钮):

In the left top is "part A". 左上方是“ A部分”。 On the right of Part A is part B. Under part A is part C and right from part C is part D. A部分的右边是B部分。A部分的下面是C部分,C部分的右边是D部分。

All parts are visible all the time. 所有部分始终可见。 The views of part A,B,C remain the same, but part D should show sometimes 2gridview/textview and sometimes a textview and a button, depending on what button is pressed on part A. A,B,C部分的视图保持不变,但D部分有时应显示2gridview / textview,有时应显示textview和一个按钮,这取决于在A部分上按下了什么按钮。

How do I define this in XML and how to show the changed part D button/texview ? 如何在XML中定义它以及如何显示更改的零件D button / texview? Do the definitions need to be in different XML files ? 定义是否需要在不同的XML文件中?

Maybe this might be a proper and clean solution for your needs: 也许这可能是满足您需求的正确而干净的解决方案:

http://developer.android.com/guide/components/fragments.html http://developer.android.com/guide/components/fragments.html

You might find it very handy and dynamic once you learn it. 学习它后,您可能会发现它非常方便且动态。 (I learnt it in a few days by myself...) (我几天后就学会了...)

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

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