0

我有一个弹出窗口,我想在两个不同的活动中使用它。问题是一项活动处于横向模式,而另一项活动处于纵向模式。我知道我可以为这些活动制作两个不同的弹出窗口,但我想知道是否有办法让相同的布局在我从横向活动启动时以横向模式启动,当我从纵向活动启动时也以纵向模式启动?

4

1 回答 1

0

Create a landscape and a portrait version of the xml for the layout. Put the portrait in the layouts folder, and the landscape in layout-land. Make them have the same name. Then when you ask to inflate that layout it will automatically pick the correct orientation.

于 2013-04-14T16:59:30.887 回答