开发者

position view based on screen orientation in android

I want to change some views whe开发者_如何学Pythonn the orientation changes for example i want to put text view from bottom of the screen to screen's right side vertically when the orientation changes from portrait to landscape mode.How to achieve it?


Create two distinct layouts with the same name (i.e. mylayout.xml), and put one in res/layout-port and the other in res/layout-land. If you call

setContentView( R.layout.mylayout );

in the onCreate() method of your activity, then Android will select the correct layout depending on whether the device is in portrait or landscape orientation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜