为iPad方位响应式设计模板 [英] Responsive design template for ipad orientations

查看:112
本文介绍了为iPad方位响应式设计模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要定制与一个iPad应用程序的风景和肖像模式不同的设计模板特定的UI。基本上,这个画面应该有一个形象,一个内容区域举行的话题介绍,该主题和地址的相关项目。

I need to customise a particular UI with different design template for landscape and portrait modes of an iPad application. Basically this screen should have an image ,a content area to hold a description about the topic, related items of that topic and the address.

这个形象将给出一个清晰的画面。

This image would give a clear picture.

从图片(2)是部分,在那里图像应该去,(4)的说明,(5)的相关主题(6)的地址。 (3)是应该有所不同根据4,5和6与容器块(1)是正确设置根据2和3,其应具有其内容的滚动视图以及内容大小

From the picture (2) is the section where image should go , (4) the description ,(5) the related topic (6) the address . (3) is the container block that should vary based on 4, 5 and 6 and (1) is the scrollview which should have its contents as well as content size properly set up based on 2 and 3 .

是否有可能实现此方案纯粹与自动布局或使用定制UICollectionViewLayout是更好的选择

Is it possible to achieve this scenario purely with Autolayout or using a custom UICollectionViewLayout is the better option

鸭preciate任何建议

Appreciate any suggestions

推荐答案

点点过时,但仍实际...

Little bit outdated, but still actual...

您可以通过引入父视图控制器将调整您的视图控制器的特点集合做到这一点。

You can do this by introducing parent view controller that will adjust trait collection of your view controller.

您可以像AdaptivePhotosAnAdaptiveApplication或项目的启动更具体 AAPLTraitOverrideViewController 类和应用规模类,使假设纵向和横向的意见的大小和位置之间的区别。

You can start with projects like AdaptivePhotosAnAdaptiveApplication or more specifically AAPLTraitOverrideViewController class and applying size classes to make distinction between let's say Portrait and Landscape orientation's views sizes and positions.

使用 viewWillTransitionToSize一些小的调整:(CGSize)大小withTransitionCoordinator:(ID< UIViewControllerTransitionCoordinator>)协调你可以实现你的目标。

With some small adjustment of viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id <UIViewControllerTransitionCoordinator>)coordinator you can achieve your goal.

在这里您可以找到code:
<一href=\"https://github.com/ios8/AdaptivePhotosAnAdaptiveApplication/blob/master/AdaptivePhotos/AAPLTraitOverrideViewController.m\" rel=\"nofollow\">https://github.com/ios8/AdaptivePhotosAnAdaptiveApplication/blob/master/AdaptivePhotos/AAPLTraitOverrideViewController.m

Here you can find code: https://github.com/ios8/AdaptivePhotosAnAdaptiveApplication/blob/master/AdaptivePhotos/AAPLTraitOverrideViewController.m

这篇关于为iPad方位响应式设计模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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