1

我正在尝试对 UISplitViewController 进行子类化以减小主控的宽度。我看过 Matt Gemmell 的MGSplitViewController - 请参阅Change the width of Master in UISplitViewController - 但它看起来比我需要的要多。我只是想以 Apple 在应用商店中接受的方式将 master 的大小从 320 减小到 260。

我对子类化按钮以外的任何东西都是新手,但这是我目前正在尝试的,尽管它目前没有做任何事情。要么我离题了,要么我错过了一些简单的东西。如何才能做到这一点?

头文件:

#import <UIKit/UIKit.h>

@interface MYSplitViewController : UISplitViewController

+ (CGFloat)masterColumnWidth;

@end

实现文件:

#import "SRSplitViewController.h"

@interface SRSplitViewController ()

@end

@implementation SRSplitViewController

+ (CGFloat)masterColumnWidth {
  return 260;
}

@end
4

1 回答 1

0

I ended up not going this route, and would recommend against trying to subclass UISplitViewController for others. It's not a flexible layout so unless you want exactly what it provides out of the box, you are going to run into time-consuming problems.

If you want a side navigation bar similar to the Facebook app, I'd recommend using JASidePanels and placing whatever size and style view controller you want in the left panel.

enter image description here

于 2013-07-12T19:19:35.583 回答