mirror of
https://github.com/zhigang1992/transshift.git
synced 2026-04-28 20:55:21 +08:00
Add NavigationController large title support for iOS 11.0
This commit is contained in:
@@ -59,6 +59,7 @@
|
||||
_serverList = instantiateController( CONTROLLER_ID_SERVERLIST );
|
||||
|
||||
UINavigationController *leftNav = [[UINavigationController alloc] initWithRootViewController:_serverList];
|
||||
preferBigTitleForNavController(leftNav);
|
||||
|
||||
UIViewController *rootController = leftNav;
|
||||
|
||||
@@ -72,6 +73,7 @@
|
||||
trc.popoverButtonTitle = NSLocalizedString(@"Servers", @"ServerListController title");//SERVERLIST_CONTROLLER_TITLE;
|
||||
|
||||
UINavigationController *rightNav = [[UINavigationController alloc] initWithRootViewController:trc];
|
||||
preferBigTitleForNavController(rightNav);
|
||||
|
||||
UISplitViewController *splitView = [[UISplitViewController alloc] init];
|
||||
splitView.viewControllers = @[ leftNav, rightNav ];
|
||||
|
||||
Binary file not shown.
@@ -29,6 +29,12 @@
|
||||
/// returns YES if this is iPhone PLUS model on iOS8
|
||||
BOOL isIPhonePlus(void);
|
||||
|
||||
/*!
|
||||
Set the large title for NavigationBar on iOS11.0+
|
||||
@param navVC - UINavigationController to set the title
|
||||
*/
|
||||
void preferBigTitleForNavController( UINavigationController *navVC );
|
||||
|
||||
|
||||
/*!
|
||||
Retruns the new instance of UIViewController
|
||||
|
||||
@@ -224,3 +224,17 @@ BOOL isIPhonePlus()
|
||||
return NO;
|
||||
}
|
||||
|
||||
// UINavigationController bit titles prefer
|
||||
void preferBigTitleForNavController( UINavigationController *navVC )
|
||||
{
|
||||
if ( @available(iOS 11.0, *) )
|
||||
{
|
||||
navVC.navigationBar.prefersLargeTitles = YES;
|
||||
navVC.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAutomatic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
|
||||
#import "RPCServerConfig.h"
|
||||
|
||||
static NSString *CODER_NAME = @"name";
|
||||
static NSString *CODER_RPC_PATH = @"path";
|
||||
static NSString *CODER_USER_NAME = @"username";
|
||||
static NSString *CODER_USER_PASSWORD = @"pass";
|
||||
static NSString *CODER_PORT = @"port";
|
||||
static NSString *CODER_HOST = @"host";
|
||||
static NSString *CODER_USE_SSL = @"ssl";
|
||||
static NSString *CODER_REFRESH_TIMEOUT = @"time";
|
||||
static NSString *CODER_REQUEST_TIMEOUT = @"reqtimeout";
|
||||
static NSString *CODER_SHOW_FREESPACE = @"showFreeSpace";
|
||||
static NSString * const CODER_NAME = @"name";
|
||||
static NSString * const CODER_RPC_PATH = @"path";
|
||||
static NSString * const CODER_USER_NAME = @"username";
|
||||
static NSString * const CODER_USER_PASSWORD = @"pass";
|
||||
static NSString * const CODER_PORT = @"port";
|
||||
static NSString * const CODER_HOST = @"host";
|
||||
static NSString * const CODER_USE_SSL = @"ssl";
|
||||
static NSString * const CODER_REFRESH_TIMEOUT = @"time";
|
||||
static NSString * const CODER_REQUEST_TIMEOUT = @"reqtimeout";
|
||||
static NSString * const CODER_SHOW_FREESPACE = @"showFreeSpace";
|
||||
|
||||
@implementation RPCServerConfig
|
||||
|
||||
@@ -51,6 +51,7 @@ static NSString *CODER_SHOW_FREESPACE = @"showFreeSpace";
|
||||
{
|
||||
if( ![_rpcPath hasPrefix:@"/"] )
|
||||
_rpcPath = [NSString stringWithFormat:@"/%@", _rpcPath];
|
||||
|
||||
return [NSString stringWithFormat:@"%@://%@:%i%@", _useSSL ? @"https" : @"http", _host, _port, _rpcPath];
|
||||
}
|
||||
|
||||
|
||||
@@ -1085,6 +1085,7 @@
|
||||
_torrentInfoController = instantiateController( CONTROLLER_ID_TORRENTINFO );
|
||||
_torrentInfoController.torrentId = torrentId;
|
||||
_torrentInfoController.delegate = self;
|
||||
_torrentInfoController.title = NSLocalizedString(@"Torrent details", nil);
|
||||
|
||||
// we should make a request to RPCConnector
|
||||
// (upon complite, info controller will be updated)
|
||||
|
||||
@@ -9,8 +9,10 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "AppDelegate.h"
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
@autoreleasepool {
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
@autoreleasepool
|
||||
{
|
||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user