- 浏览: 44555 次
- 性别:
- 来自: 上海
最新评论
-
chengt:
http://jareye.com/
推荐一个下载jar包的网站-----jareye.com -
chengt:
http://jareye.com/
推荐一个下载jar包的网站-----jareye.com
[quote=""]UINavigationController iPhone导航控制器/导航栏 是在iPhone程序中广为使用的用户数据互动方式。
这是一个简单的导航栏截图,我们可以设置其内置UIView的title,而导航栏会显示出这个title。而不是设置导航栏的title。我们也可以设置其左侧,或者右侧的按钮或者自定义视图对象。我们下面来一步一步的看看导航栏的使用:
创建并使用一个UINavigationController
UINavigationController *aNav = [[UINavigationController alloc] init];
然后添加一个视图进去,否则导航栏也没有意义的
UIViewController *aView = [[UIView alloc] initWithNibName: (*xib文件名*)];
[aNav pushViewController:aView animated:NO];
//导航栏的第一个视图不要动画化
设置导航栏的左右按钮:
我说过,设置导航栏的按钮并不是去设置导航栏本身,而是当时被导航的视图控制器,比如我们对aView作设置。
设置其标题:
aView.title = @"标题";
UIBarButtonItem *callModalViewButton = [[UIBarButtonItem alloc]
initWithTitle:@"Button"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(callModalList)];
self.navigationItem.leftBarButtonItem = callModalViewButton;
[callModalViewButton release]; //由于本地视图会retain它,所以我们可以release了
可以看到,还是很简单的嘛。
其他常用方法和属性:
本地视图.navigationItem.leftBarButtonItem //左边栏项目
本地视图.navigationItem.rightBarButtonItem //右边栏项目
本地视图.navigationItem.backBarButtonItem //后退栏项目
本地视图.navigationItem.hidesBackButton //隐藏后退按钮(YES or NO)
Navigation Controller 是最重要的iPhone组建之一了,以下是一些“关键方法”
pushViewController:viewController animated:BOOL
(加载视图控制器)
– 添加指定的视图控制器并予以显示,后接:是否动画显示
popViewControllerAnimated:BOOL
(弹出当前视图控制器)
– 弹出并向左显示前一个视图
popToViewController:viewController animated:BOOL
(弹出到指定视图控制器)
– 回到指定视图控制器, 也就是不只弹出一个
popToRootViewControllerAnimated:BOOL
(弹出到根视图控制器)
– 比如说你有一个“Home”键,也许就会实施这个方法了。
setNavigationBarHidden:BOOL animated:BOOL
(设置导航栏是否显示)
– 如果你想隐藏导航栏,这就是地方了。参照Picasa的WebApp样式
Navigation Controller 模式弹出新的Navigation Controller
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:addViewController];
[self.navigationController presentModalViewController:navController animated:YES];
或: SubView *printView=[[EIPrintPreprint alloc] initWithNibName:@"SubView" bundle:nil]; [self presentModalViewController:printView animated:YES]; [printView release];
实现pushViewController:animated:的不同页面转换特效
1. 首先要明确的是,不使用pushViewController的默认动画,所以在调用这个函数时,要将animated设置为NO.
2. 使用普通的来CATransition实现转换效果,代码如下:
CATransition *animation = [CATransition animation];
[animation setDuration:0.3];
[animation setType: kCATransitionMoveIn];
[animation setSubtype: kCATransitionFromTop];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]];
[self.navigationController pushViewController:m_poseAddIssueViewController animated:NO];
[self.navigationController.view.layer addAnimation:animation forKey:nil];
1,add a navigationcontroller to window
UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
//set a root controller
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:[[HelloController alloc] init]];
[window addSubview:nav.view];
[window makeKeyAndVisible];
2.set title with info.plist
self.title = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
3.custom back button
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"back" style:UIBarButtonItemStylePlain
target:nil action:nil];
self.navigationItem.backBarButtonItem = backButton;
[backButton release];
4.add a segment to navigationItem
NSArray *buttonNames = [NSArray arrayWithObjects:@"One", @"Two", @"Three", @"Four", nil];
UISegmentedControl* segmentedControl = [[UISegmentedControl alloc] initWithItems:buttonNames];
segmentedControl.momentary = YES;
[(UITextView *)self.view setText:@""];
segmentedControl.autoresizingMask = UIViewAutoresizingFlexibleWidth;
segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
segmentedControl.frame = CGRectMake(0, 0, 400, 30);
[segmentedControl addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged];
self.navigationItem.titleView = segmentedControl;
[segmentedControl release];
5.toolbar in navigation
NSMutableArray *buttons = [[NSMutableArray alloc] initWithCapacity:4];
UIBarButtonItem *flexibleSpaceItem;
flexibleSpaceItem = [[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil action:NULL] autorelease];
[buttons addObject:flexibleSpaceItem];
[flexibleSpaceItem release];
UIBarButtonItem *item;
item = [[UIBarButtonItem alloc]
initWithImage:[UIImage imageNamed:@"down.png"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(decrement:)];
[buttons addObject:item];
[item release];
item = [[UIBarButtonItem alloc]
initWithImage:[UIImage imageNamed:@"up.png"]
style:UIBarButtonItemStylePlain target:self
action:@selector(increment:)];
[buttons addObject:item];
[item release];
flexibleSpaceItem = [[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil action:NULL] autorelease];
[buttons addObject:flexibleSpaceItem];
[flexibleSpaceItem release];
UIToolbar *toolbar = [[UIToolbar alloc] init];
toolbar.barStyle = UIBarStyleBlackOpaque;
[toolbar setItems:buttons animated:YES];
[toolbar sizeToFit];
self.navigationItem.titleView = toolbar;
[toolbar release];
// Add a left button
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc]
initWithTitle:@"Red"
style:UIBarButtonItemStylePlain
target:self
action:@selector(goRed)] autorelease];
// Add a right button
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]
initWithTitle:@"Blue"
style:UIBarButtonItemStylePlain
target:self
action:@selector(goBlue)] autorelease];
6 可拖动图片选项栏
#import <UIKit/UIKit.h>
#import "math.h"
@interface BrightnessController : UIViewController
{
int brightness;
}
@end
@implementation BrightnessController
// MyCreateBitmapContext: Source based on Apple Sample Code
CGContextRef MyCreateBitmapContext (int pixelsWide,
int pixelsHigh)
{
CGContextRef context = NULL;
CGColorSpaceRef colorSpace;
void * bitmapData;
int bitmapByteCount;
int bitmapBytesPerRow;
bitmapBytesPerRow = (pixelsWide * 4);
bitmapByteCount = (bitmapBytesPerRow * pixelsHigh);
colorSpace = CGColorSpaceCreateDeviceRGB();
bitmapData = malloc( bitmapByteCount );
if (bitmapData == NULL)
{
fprintf (stderr, "Memory not allocated!");
CGColorSpaceRelease( colorSpace );
return NULL;
}
context = CGBitmapContextCreate (bitmapData,
pixelsWide,
pixelsHigh,
8,
bitmapBytesPerRow,
colorSpace,
kCGImageAlphaPremultipliedLast);
if (context== NULL)
{
free (bitmapData);
fprintf (stderr, "Context not created!");
return NULL;
}
CGColorSpaceRelease( colorSpace );
return context;
}
// addRoundedRectToPath: Source based on Apple Sample Code
static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWidth,
float ovalHeight)
{
float fw, fh;
if (ovalWidth == 0 || ovalHeight == 0) {
CGContextAddRect(context, rect);
return;
}
CGContextSaveGState(context);
CGContextTranslateCTM(context, CGRectGetMinX(rect), CGRectGetMinY(rect));
CGContextScaleCTM(context, ovalWidth, ovalHeight);
fw = CGRectGetWidth(rect) / ovalWidth;
fh = CGRectGetHeight(rect) / ovalHeight;
CGContextMoveToPoint(context, fw, fh/2); // Start at lower right corner
CGContextAddArcToPoint(context, fw, fh, fw/2, fh, 1); // Top right corner
CGContextAddArcToPoint(context, 0, fh, 0, fh/2, 1); // Top left corner
CGContextAddArcToPoint(context, 0, 0, fw/2, 0, 1); // Lower left corner
CGContextAddArcToPoint(context, fw, 0, fw, fh/2, 1); // Back to lower right
CGContextClosePath(context);
CGContextRestoreGState(context);
}
// Build an image tinted at the given percentage
id createImage(float percentage)
{
CGContextRef context = MyCreateBitmapContext(30, 30);
addRoundedRectToPath(context, CGRectMake(0.0f, 0.0f, 30.0f, 30.0f), 4.0f, 4.0f);
CGFloat gray[4] = {percentage, percentage, percentage, 1.0f};
CGContextSetFillColor(context, gray);
CGContextFillPath(context);
CGImageRef myRef = CGBitmapContextCreateImage (context);
free(CGBitmapContextGetData(context));
CGContextRelease(context);
return [UIImage imageWithCGImage:myRef];
}
#define MAXDEPTH 8
-(BrightnessController *) initWithBrightness: (int) aBrightness
{
self = [super init];
brightness = aBrightness;
self.title = [NSString stringWithFormat:@"%d%%", brightness * 10];
[self.tabBarItem initWithTitle:self.title image:createImage(((float) brightness / 10.0f)) tag:0];
return self;
}
- (void)loadView
{
UIView *contentView = [[UIView alloc] init];
float percent = brightness * 0.1;
contentView.backgroundColor = [UIColor colorWithRed:percent green:percent blue:percent alpha:1.0];
contentView.autoresizesSubviews = YES;
contentView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
self.view = contentView;
[contentView release];
}
@end
@interface SampleAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate>
@end
@implementation SampleAppDelegate
- (void)applicationDidFinishLaunching:(UIApplication *)application {
UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Create the array of UIViewControllers
NSMutableArray *controllers = [[NSMutableArray alloc] init];
for (int i = 0; i < 11; i++) {
BrightnessController *bControl = [[BrightnessController alloc] initWithBrightness:i];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:bControl];
nav.navigationBar.barStyle = UIBarStyleBlackTranslucent;
[controllers addObject:nav];
[bControl release];
[nav release];
}
// Create the toolbar and add the view controllers
UITabBarController *tbarController = [[UITabBarController alloc] init];
tbarController.viewControllers = controllers;
tbarController.customizableViewControllers = controllers;
tbarController.delegate = self;
// Set up the window
[window addSubview:tbarController.view];
[window makeKeyAndVisible];
[controllers release];
}
@end
int main(int argc, char *argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"SampleAppDelegate");
[pool release];
return retVal;
}
这是一个简单的导航栏截图,我们可以设置其内置UIView的title,而导航栏会显示出这个title。而不是设置导航栏的title。我们也可以设置其左侧,或者右侧的按钮或者自定义视图对象。我们下面来一步一步的看看导航栏的使用:
创建并使用一个UINavigationController
UINavigationController *aNav = [[UINavigationController alloc] init];
然后添加一个视图进去,否则导航栏也没有意义的
UIViewController *aView = [[UIView alloc] initWithNibName: (*xib文件名*)];
[aNav pushViewController:aView animated:NO];
//导航栏的第一个视图不要动画化
设置导航栏的左右按钮:
我说过,设置导航栏的按钮并不是去设置导航栏本身,而是当时被导航的视图控制器,比如我们对aView作设置。
设置其标题:
aView.title = @"标题";
UIBarButtonItem *callModalViewButton = [[UIBarButtonItem alloc]
initWithTitle:@"Button"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(callModalList)];
self.navigationItem.leftBarButtonItem = callModalViewButton;
[callModalViewButton release]; //由于本地视图会retain它,所以我们可以release了
可以看到,还是很简单的嘛。
其他常用方法和属性:
本地视图.navigationItem.leftBarButtonItem //左边栏项目
本地视图.navigationItem.rightBarButtonItem //右边栏项目
本地视图.navigationItem.backBarButtonItem //后退栏项目
本地视图.navigationItem.hidesBackButton //隐藏后退按钮(YES or NO)
Navigation Controller 是最重要的iPhone组建之一了,以下是一些“关键方法”
pushViewController:viewController animated:BOOL
(加载视图控制器)
– 添加指定的视图控制器并予以显示,后接:是否动画显示
popViewControllerAnimated:BOOL
(弹出当前视图控制器)
– 弹出并向左显示前一个视图
popToViewController:viewController animated:BOOL
(弹出到指定视图控制器)
– 回到指定视图控制器, 也就是不只弹出一个
popToRootViewControllerAnimated:BOOL
(弹出到根视图控制器)
– 比如说你有一个“Home”键,也许就会实施这个方法了。
setNavigationBarHidden:BOOL animated:BOOL
(设置导航栏是否显示)
– 如果你想隐藏导航栏,这就是地方了。参照Picasa的WebApp样式
Navigation Controller 模式弹出新的Navigation Controller
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:addViewController];
[self.navigationController presentModalViewController:navController animated:YES];
或: SubView *printView=[[EIPrintPreprint alloc] initWithNibName:@"SubView" bundle:nil]; [self presentModalViewController:printView animated:YES]; [printView release];
实现pushViewController:animated:的不同页面转换特效
1. 首先要明确的是,不使用pushViewController的默认动画,所以在调用这个函数时,要将animated设置为NO.
2. 使用普通的来CATransition实现转换效果,代码如下:
CATransition *animation = [CATransition animation];
[animation setDuration:0.3];
[animation setType: kCATransitionMoveIn];
[animation setSubtype: kCATransitionFromTop];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]];
[self.navigationController pushViewController:m_poseAddIssueViewController animated:NO];
[self.navigationController.view.layer addAnimation:animation forKey:nil];
1,add a navigationcontroller to window
UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
//set a root controller
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:[[HelloController alloc] init]];
[window addSubview:nav.view];
[window makeKeyAndVisible];
2.set title with info.plist
self.title = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
3.custom back button
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"back" style:UIBarButtonItemStylePlain
target:nil action:nil];
self.navigationItem.backBarButtonItem = backButton;
[backButton release];
4.add a segment to navigationItem
NSArray *buttonNames = [NSArray arrayWithObjects:@"One", @"Two", @"Three", @"Four", nil];
UISegmentedControl* segmentedControl = [[UISegmentedControl alloc] initWithItems:buttonNames];
segmentedControl.momentary = YES;
[(UITextView *)self.view setText:@""];
segmentedControl.autoresizingMask = UIViewAutoresizingFlexibleWidth;
segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
segmentedControl.frame = CGRectMake(0, 0, 400, 30);
[segmentedControl addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged];
self.navigationItem.titleView = segmentedControl;
[segmentedControl release];
5.toolbar in navigation
NSMutableArray *buttons = [[NSMutableArray alloc] initWithCapacity:4];
UIBarButtonItem *flexibleSpaceItem;
flexibleSpaceItem = [[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil action:NULL] autorelease];
[buttons addObject:flexibleSpaceItem];
[flexibleSpaceItem release];
UIBarButtonItem *item;
item = [[UIBarButtonItem alloc]
initWithImage:[UIImage imageNamed:@"down.png"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(decrement:)];
[buttons addObject:item];
[item release];
item = [[UIBarButtonItem alloc]
initWithImage:[UIImage imageNamed:@"up.png"]
style:UIBarButtonItemStylePlain target:self
action:@selector(increment:)];
[buttons addObject:item];
[item release];
flexibleSpaceItem = [[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil action:NULL] autorelease];
[buttons addObject:flexibleSpaceItem];
[flexibleSpaceItem release];
UIToolbar *toolbar = [[UIToolbar alloc] init];
toolbar.barStyle = UIBarStyleBlackOpaque;
[toolbar setItems:buttons animated:YES];
[toolbar sizeToFit];
self.navigationItem.titleView = toolbar;
[toolbar release];
// Add a left button
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc]
initWithTitle:@"Red"
style:UIBarButtonItemStylePlain
target:self
action:@selector(goRed)] autorelease];
// Add a right button
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]
initWithTitle:@"Blue"
style:UIBarButtonItemStylePlain
target:self
action:@selector(goBlue)] autorelease];
6 可拖动图片选项栏
#import <UIKit/UIKit.h>
#import "math.h"
@interface BrightnessController : UIViewController
{
int brightness;
}
@end
@implementation BrightnessController
// MyCreateBitmapContext: Source based on Apple Sample Code
CGContextRef MyCreateBitmapContext (int pixelsWide,
int pixelsHigh)
{
CGContextRef context = NULL;
CGColorSpaceRef colorSpace;
void * bitmapData;
int bitmapByteCount;
int bitmapBytesPerRow;
bitmapBytesPerRow = (pixelsWide * 4);
bitmapByteCount = (bitmapBytesPerRow * pixelsHigh);
colorSpace = CGColorSpaceCreateDeviceRGB();
bitmapData = malloc( bitmapByteCount );
if (bitmapData == NULL)
{
fprintf (stderr, "Memory not allocated!");
CGColorSpaceRelease( colorSpace );
return NULL;
}
context = CGBitmapContextCreate (bitmapData,
pixelsWide,
pixelsHigh,
8,
bitmapBytesPerRow,
colorSpace,
kCGImageAlphaPremultipliedLast);
if (context== NULL)
{
free (bitmapData);
fprintf (stderr, "Context not created!");
return NULL;
}
CGColorSpaceRelease( colorSpace );
return context;
}
// addRoundedRectToPath: Source based on Apple Sample Code
static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWidth,
float ovalHeight)
{
float fw, fh;
if (ovalWidth == 0 || ovalHeight == 0) {
CGContextAddRect(context, rect);
return;
}
CGContextSaveGState(context);
CGContextTranslateCTM(context, CGRectGetMinX(rect), CGRectGetMinY(rect));
CGContextScaleCTM(context, ovalWidth, ovalHeight);
fw = CGRectGetWidth(rect) / ovalWidth;
fh = CGRectGetHeight(rect) / ovalHeight;
CGContextMoveToPoint(context, fw, fh/2); // Start at lower right corner
CGContextAddArcToPoint(context, fw, fh, fw/2, fh, 1); // Top right corner
CGContextAddArcToPoint(context, 0, fh, 0, fh/2, 1); // Top left corner
CGContextAddArcToPoint(context, 0, 0, fw/2, 0, 1); // Lower left corner
CGContextAddArcToPoint(context, fw, 0, fw, fh/2, 1); // Back to lower right
CGContextClosePath(context);
CGContextRestoreGState(context);
}
// Build an image tinted at the given percentage
id createImage(float percentage)
{
CGContextRef context = MyCreateBitmapContext(30, 30);
addRoundedRectToPath(context, CGRectMake(0.0f, 0.0f, 30.0f, 30.0f), 4.0f, 4.0f);
CGFloat gray[4] = {percentage, percentage, percentage, 1.0f};
CGContextSetFillColor(context, gray);
CGContextFillPath(context);
CGImageRef myRef = CGBitmapContextCreateImage (context);
free(CGBitmapContextGetData(context));
CGContextRelease(context);
return [UIImage imageWithCGImage:myRef];
}
#define MAXDEPTH 8
-(BrightnessController *) initWithBrightness: (int) aBrightness
{
self = [super init];
brightness = aBrightness;
self.title = [NSString stringWithFormat:@"%d%%", brightness * 10];
[self.tabBarItem initWithTitle:self.title image:createImage(((float) brightness / 10.0f)) tag:0];
return self;
}
- (void)loadView
{
UIView *contentView = [[UIView alloc] init];
float percent = brightness * 0.1;
contentView.backgroundColor = [UIColor colorWithRed:percent green:percent blue:percent alpha:1.0];
contentView.autoresizesSubviews = YES;
contentView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
self.view = contentView;
[contentView release];
}
@end
@interface SampleAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate>
@end
@implementation SampleAppDelegate
- (void)applicationDidFinishLaunching:(UIApplication *)application {
UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Create the array of UIViewControllers
NSMutableArray *controllers = [[NSMutableArray alloc] init];
for (int i = 0; i < 11; i++) {
BrightnessController *bControl = [[BrightnessController alloc] initWithBrightness:i];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:bControl];
nav.navigationBar.barStyle = UIBarStyleBlackTranslucent;
[controllers addObject:nav];
[bControl release];
[nav release];
}
// Create the toolbar and add the view controllers
UITabBarController *tbarController = [[UITabBarController alloc] init];
tbarController.viewControllers = controllers;
tbarController.customizableViewControllers = controllers;
tbarController.delegate = self;
// Set up the window
[window addSubview:tbarController.view];
[window makeKeyAndVisible];
[controllers release];
}
@end
int main(int argc, char *argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"SampleAppDelegate");
[pool release];
return retVal;
}
发表评论
-
iOS开发中如何解决TableView中图片延时加载
2012-06-01 13:44 1632IOS开发中如何解决TableView中图片延时加载是本文要介 ... -
让模拟器也支持GPS定位(模拟实现)
2012-06-01 13:36 2134iOS上的GPS定位一般需要真机才能看到效果,但在开发的过程中 ... -
判断UITextField的输入只为数字的方法
2012-06-01 13:35 1132实现下面的委托 #define NUMBERS @" ... -
反向地理编码用法
2012-06-01 13:33 1136与地图打交道时,有时需要查找经纬度获取地理信息,MapKit提 ... -
关于出现僵尸信号SIGBAT或者EXC_BAD_ACCESS的解决方案
2012-06-01 13:31 662随着用xcode开发的深入,相信很多同学都对出现SIGBAT或 ... -
iOS 应用的 UI 开发资源
2012-05-28 23:27 945中文 http://blog.csdn.net/column ... -
汉字转拼音
2012-05-20 19:47 1264// // ChineseToPinyin.h // ... -
修改图标上的提示符(badge)
2012-05-20 19:35 959程序推送,或者AppStore软件有更新都会有提示,那代码怎么 ... -
Info.plist中常用的key简介
2012-05-20 19:10 917UIRequiresPersistentWiFi 在程序中弹出 ... -
返回 父级 的父级 view
2012-05-09 14:48 892[color=blue]有3个view A,B,C A是第一级 ... -
如何获取view的controller
2012-05-09 14:45 1487[b]如何获取view的controller[/b] ... -
xcode4 svn+ssh
2012-05-04 22:18 11221. Clear the contents of your ~ ... -
多线程的使用与注意事项
2012-03-17 11:20 1260多线程的使用与注意事项 这一回,主要介绍一下iPhone ... -
在程序中使用GPS定位
2012-03-17 10:28 854这一回简单地介绍一下G ... -
开源ZXing在XCode上如何使用
2012-03-17 10:18 9711.在 zxing/iphone/ZXingWidget/里的 ... -
iphone 二维码 使用说明
2012-03-17 10:16 1103转自:http://blog.csdn.net/linkai5 ... -
iphone开发随笔,有用的
2012-03-14 20:52 7431.将view设置成圆角 首先导入QuartzCore.fra ... -
iphone开发中发送短信
2012-03-14 20:46 1322iOS4.0新加入了MFMessageComposeViewC ... -
iphone中设置控件语言
2012-03-14 20:40 876最近项目遇到这样一个问题: 发送短信时,发现控件显示的是英 ... -
How to use ZXing(decode qr code) .
2012-03-14 20:26 1272ZXing for iOS is a sub-project ...
相关推荐
我们写iOS项目的时候,基本都是一个UINavigationController套一个UITabBarController的形式,就是上面一个导航栏,下面几个按钮的工具条的形式。我写了几个应用,发现如果每次都重新写的话完全就是浪费精力和时间,...
在iOS应用开发中,`UITabBarController` 和 `UINavigationController` 是两种常用且重要的控制器,它们各自负责不同的界面展示逻辑。`UITabBarController` 通常用于实现底部标签栏切换不同功能模块,而 `...
在iOS开发中,UINavigationController是苹果提供的一种容器类视图控制器,它负责管理一个堆栈式的视图控制器序列。在iOS 7之前,用户通常通过导航栏上的返回按钮或者手势来实现页面间的切换。然而,随着iOS 7的发布...
在iOS开发中,`UINavigationController`是苹果提供的一种强大的视图控制器容器,它负责管理一个堆栈式的视图控制器序列,通常用于实现页面间的导航。本篇将深入讲解`UINavigationController`的页面切换机制以及如何...
在iOS应用开发中,`UITabBarController`、`UINavigationController`和`UIViewController`是三个非常重要的视图控制器类,它们协同工作,构建出用户友好的界面和流畅的导航体验。`UITabBarController`用于实现底部...
在iOS应用开发中,页面间的跳转是用户体验的重要组成部分,而`UINavigationController`是苹果提供的一个强大工具,用于管理屏幕间的导航。这个类提供了一种优雅的方式来组织和控制多个`UIViewController`实例,允许...
上传的demo关于UINavigationController中back按钮的重写方法, UINavigationController的back按妞本身是没有监听方法的,但是我们通过添加类目可以使back按钮具有监听的作用.让我们能在UINavigationController触发返回...
在iOS开发中,`UINavigationController`是苹果提供的一种强大的视图控制器容器,它负责管理一个堆栈式的视图控制器序列,通常用于实现类似iOS设备上的导航界面。`UINavigationController`在应用中的作用至关重要,它...
在iOS应用开发中,`UINavigationController`是苹果提供的一个核心组件,主要用于管理多个视图控制器的堆栈,实现页面间的导航。本示例代码“UINavigationController Demo”将深入讲解如何在iOS应用中有效地使用`...
在iOS应用开发中,`UINavigationController`是苹果提供的一个核心组件,它负责管理一系列的`UIViewController`对象,形成一个导航栈。这个栈的顶部视图控制器通常显示在屏幕上,而其他视图控制器则被压入栈中等待...
导航控制器(UINavigationController)用来管理一系列显示层次型信息的场景。一般而言,逐步显示更详细的信息。 导航控制器 -- 用户在场景之间切换时,导航控制器依次将视图控制器压入(push)堆栈中,且当前场景的...
在iOS应用开发中,`UINavigationController`是苹果提供的一个核心组件,用于管理多个`UIViewController`的堆栈,实现页面间的导航。本篇文章将深入探讨如何对`UINavigationController`进行自定义,特别是关于...
* 从iOS7开始,系统为UINavigationController提供了一个interactivePopGestureRecognizer用于右滑返回(pop),但是,如果自定了返回按钮或者隐藏了navigationBar,该手势就失效了。 ## 原因 * 自定义返回按钮或者隐藏...
UITabBarController和UINavigationController的整合使用DEMO,详情见:http://blog.csdn.net/hwe_xc/article/details/50588500
让 UINavigationController 支持全屏操作手势.zip,A UINavigationController's category to enable fullscreen pop gesture with iOS7 system style.
很多时候我们创建一个基于UITabBarController的application以后还希望能够在每个tab view都可以实现导航控制,即添加一个UINavigationController来实现tabview内部的view之间的切换,这即是本文所要介绍的。
uinavigationcontroller是iOS开发中的一个核心组件,它用于管理一系列UIViewController的堆栈,提供导航界面。这个"uinavigationcontroller用法.rar"文件很显然是为了详细解释如何在Objective-C的环境中利用...
自定义UITabBar,layoutSubviews重写UITabBarButton位置,重写则hitTest方法并监听按钮的点击 自定义的UITabBarController和UINavigationController