iOS splitviewer controller
来源:互联网 发布:淘宝的购物评级怎么看 编辑:程序博客网 时间:2024/05/16 04:39
http://useyourloaf.com/blog/2011/10/19/ios-5-split-view-controller-changes.html
The split view is something very cool within the new iPhone OS 3.2. It allows us to visualize a master-detail view in a very simple manner. Combined with iPads’ big display of 1024×748 pixels it will be possible to create even better, more user-friendly and valuable applications.
Basically, the split view consists of two separate views. The master view will be shown in a 320 pixel width part on your screen if your iPad is at landscape orientation, otherwise the master view will be accessible as a popover view. The details view should show your main content and will be at full size if your iPad is at portrait orientation. Mainly the user will be focused at your details view and this fact you should keep in mind.
Creating a split view pragmatically within your application is a easy task. The following code will show this:
//adjust detail view f = detail.view.frame; f.size.width = 830; f.size.height = 1024; f.origin.x = 320; f.origin.y = 0; [detail.view setFrame:f];
_hidesMasterViewInPortrait member variable.
@interface UISplitViewController (ShowMasterInPortrait)
- (void)setHidesMasterViewInPortrait:(BOOL)hidden;
@end
@implementation UISplitViewController (ShowMasterInPortrait)
- (void)setHidesMasterViewInPortrait:(BOOL)hidden
{
_hidesMasterViewInPortrait = (hidden) ? 0 : 1;
}
@end
for iOS 5:
http://useyourloaf.com/blog/2011/10/19/ios-5-split-view-controller-changes.html
http://www.edumobile.org/iphone/ipad-development/splitview-application-in-ipad/
其实,很多时候的解决方法是真的不是真的可行的,要不停尝试:
http://stackoverflow.com/questions/4624234/forcing-an-ipad-app-to-show-splitview-even-in-portrait-orientationlike-the-sett
as this guy:
I am trying to develop a splitView based iPad app, that displays the split interface in every orientation. I have tried subclassing the UISplitViewController class as given in this tutorial, but it doesn't work. I tried creating a category to set _hidesMasterViewInPortrait = (hidden) ? 0 : 1;
, as suggested in one of the comments in the above blog, but nothing worked.
yeah. i am that guy also....
haha, you can see this :
here is the way it works
[splitViewController setHidesMasterViewInPortrait:NO];
//[self.splitViewController setHidesMasterViewInPortrait:NO]; //这个在iOS SDKbase 5.1 的情况下似乎也是不 work的。so find normal support way,走正道才是王道啊
要访问私有变量,要尽量绕开编译器的检查::: 再次提示,走正道才是王道
_displayedItems
is a private ivar, so you shouldn't access it, even from a category.
That said, you should try compiling the same code with
gcc -arch i386
and
gcc -arch x86_64
and see the difference. In the 32 bit mode you don't see the error. This shows how fragile the situation is. You really shouldn't.
That said, there's a way to get that ivar by abusing KVC:
@implementation NSCollectionView (displayedItems)- (NSMutableArray *)myDisplayedItems{ return [self valueForKey:@"displayedItems"];}@end
Note that you shouldn't name your method just as displayedItems
. That would make an infinite loop, because the KVC machinery would find your method earlier than the ivar.
- iOS splitviewer controller
- iOS Controller 结构图
- ios controller嵌套
- iOS view controller 生命周期
- ios controller之间传递参数
- iOS笔记 Collection View Controller
- ios controller之间传递参数
- IOS 开发 View Controller 综述
- IOS中的Model-View-Controller
- iOS 弹出透明controller效果
- IOS Present View Controller 详解
- IOS学习日志(Controller)1.1
- IOS学习日志(Controller)1.2
- IOS学习日志(Controller)1.3
- IOS学习日志(Controller)1.4
- IOS学习日志(Controller)1.5
- IOS学习日志(Controller)1.6
- IOS学习日志(Controller)1.7
- js时间操作
- 解决「问题」,不要解决问题
- gcc 与 g++的不同点 搞不懂
- 飞漫软件十年回顾-MiniGUI 及飞漫软件创始人
- evc4.0的安装与配置
- iOS splitviewer controller
- objective-c 之数据类型和表达式
- 程序员才能看得懂的哲理
- pdf库
- how to record build log on linux
- ORA-27054 NFS file system where the file is created or resides is not mounted with correct options
- lucene 学习笔记
- Android开发----问题解决
- Lumia 900被曝数据连接出问题