重新定位控件时的方向变化 [英] Repositioning controls when the orientation changes

查看:143
本文介绍了重新定位控件时的方向变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道自动布局可以用于使尺寸和位置相一致时,取向的变化。是否有可能完全改变布局时,方向的变化?

I know Auto Layout can be used to make the sizes and position consistent when the orientation changes. Is it possible to completely change the layout when the orientation changes?

例如,请看看一个简单的登录屏幕在纵向模式下面的线框。

For example, please look at the below wire-frame of a simple login screen in portrait mode.

现在,如果我旋转设备,我要彻底重新定位控制。

Now if I rotate the device, I want to completely re-position the controls.

可这种事情可以通过使用自动布局做了什么?如果不是这样,我应该怎么去呢?

Can this kind of a thing be done by using Auto Layout? If not, how should I go about this?

感谢您。

推荐答案

在你的情况下,它可以通过两种方法来实现,而不是重新定义每个组件可以群,如控制下。

In your case it can be achieved by two methods, instead of reframing every component you can group the controls like the following..


  1. 父视图 - >用户资料查看 - >所有用户信息控制。通过这样做,你将不得不重构只是在用户资料查看不是所有的控件..

那么只有商标和公司名称留下来重构..共3控制重新构建,如果你组你的控件。

Then only Logo and Company name left to reframe.. Total 3 controls to reframe if you group your controls..

创建肖像等为风景模式两种观点之一,只需添加和删除转..这是因为你不会有调整由繁琐code帧的最快方法。

Create two views one for Portrait and other for Landscape mode, and just add and remove on rotations.. this is the fastest way as you won't have to readjust the frame by tedious code.

以上希望有所帮助。

这篇关于重新定位控件时的方向变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆