English 中文(简体)
LinearLayout(动力学)和屏幕定向问题
原标题:LinearLayout (dynamic) and screen orientation problem

我试图创建一种在大多数情况下运转良好的习俗号码。 唯一的问题就是充满活力的布局。 排位包括:

  • two buttons ("+" at the top and "-" at the bottom in portrait mode)
  • one edit

在构造中(“制造商扩展线”) 我在外加三个部分,在布局中添加“意见”。

在以景观方式看待这一布局时,我想到的是,纽埃和“+”等纽芬兰人不会站在上下,而是在右边和左边,因为否则数字制造商的规模太大。

By using the event onConfigurationChanged I check if the user has changed the screen orientation and set the orientation of the LinearLayout to horizontal and vertical. The problem is that the "+"- and "-"-Buttons are on wrong positions. It should look this way (e.g. in landscape):

“-”

但它看着这种方式:

"+" | edit | "-"

我如何解决这一问题? 我谨按正确的顺序排列各州。 我能否通过使用XML解决这一问题?

谢谢。

最佳回答

虽然如果不采用XML,也许可以解决你的问题,但我认为使用这些办法不是一个坏的想法(例如,使用getLayoutInflater(<>sinflate(<>),这反映了你可以形成的一种看法。

如果你手工处理组合变化(使用configurationChanges=“key板Hiddenoration>),那么你将需要利用上述幻灯重新检索XML文档。 否则,活动将轮流销毁,适当资源将自动收回。 如果你把你的孔隙XML文件放在<条码>下<>-条码>夹中,而另一个放在<条码>---地上,那么它就应当全部完成。

问题回答

你可以有两种不同的布局,一种是孔隙,另一种是景观。 如果你采用横向线性方向,那么你就可以将 minu子放在加顿之前。





相关问题
Very basic WPF layout question

How do I get this listbox to be maxiumum size, i.e. fill the group box its in. I ve tried width="auto" Height="auto", width="stretch" Height="stretch" annoyingly at the moment, it dynamicly sizes to ...

How to align the text to top of TextView?

How to align the text to top of a TextView? Equivalent Android API for Swings setInsets()? that is top of text should start be in (0,0) of TextView <?xml version="1.0" encoding="utf-8"?> <...

Centring a flow in Shoes

Can I center the contents of a flow in Shoes? I know that a paragraph can be centred like: para Centred paragrpah , :align=> center However, this does not work with flows: flow(:align=> ...

Overlaying with CSS

I want to load a website in an iframe, and overlay the website with some hints about the website that is shown. However, i got stuck at the point that the website has a variable passive white space at ...

How do you normally make a program look beautiful? [closed]

How can I make an Application look nice and not like an amateur pulled it together? I mean graphic-wise. Is there some sort of book you can read regarding beautiful program layouts, etc? I put this ...

热门标签