上一页 1 ··· 7 8 9 10 11 12 下一页
  2012年6月5日
摘要: 添加分段控件控件是一种小型的、自包含的UI组件,可以用在各种UI Kit类中。它们可以被附着在许多不同类型的对象之上,让开发者可以在窗口中添加额外的功能。有一个控件在苹果公司预装的应用程序的导航栏中经常见到,这就是分段控件。你会注意到,在许多预置的应用程序中,苹果公司加入一些按钮以便对显示的信息做进一步分类。例如,iTunes WiFi Store应用程序的导航栏上就显示着"最新发行"、"热门金曲"、"风格流派"等按钮。这些按钮进一步划分了用户的乐曲选择方式。分段控件就适用于这种 情况:存在大量相似数据,最好用两到三个按钮对数据进行分 阅读全文
posted @ 2012-06-05 17:29 tx天翔 阅读(31751) 评论(1) 推荐(2) 编辑
摘要: http://bbs.weiphone.com/read-htm-tid-2323882.html 阅读全文
posted @ 2012-06-05 16:55 tx天翔 阅读(277) 评论(0) 推荐(1) 编辑
摘要: 赋予内容视图中的文字可以通过一个名为text的属性来设置。这个属性接受一个NSString作为参数。下面给出了一种设置静态文本的简单方法:textView.text=@"Hello,world!";你也可以用NSString类中的多种字符串创建方法,来定制创建字符串对象:intnBottles=100; NSString*myFormattedString=[[NSStringalloc] initWithFormat:@"%dbottlesofbeeronthewall",nBottles ]; textView.text=myFormattedStr 阅读全文
posted @ 2012-06-05 16:14 tx天翔 阅读(6253) 评论(0) 推荐(0) 编辑
摘要: 文字色彩可以用一个UIColor对象来定义文字的色彩。UIColor这个类提供了许多不同的方法,可以很轻松地调出任何颜色。你可以用静态方法来创建 颜色,这样它们会在停止使用后被释放。可以用灰度值、色相或者RGB复合值等多种形式来创建颜色。要创建一个简单的RGB色彩,可以指定一组4个浮点值, 分别对应红、绿、蓝和alpha值(透明度),取值均在0.0~1.0之间。这些值表示了0%(0.0)~100%(1.0)的范围:UIColor*myWhiteTransparentColor=[UIColorcolorWithWhite:1.0alpha:0.50]; UIColor*myColorHue=[ 阅读全文
posted @ 2012-06-05 16:04 tx天翔 阅读(16065) 评论(0) 推荐(0) 编辑
摘要: datePicker的简单使用方法:(注意连线)- (IBAction)buttonpressed:(id)sender { NSDate *selected = [datePicker date]; NSTimeZone *timeZone3 = [NSTimeZone timeZoneForSecondsFromGMT:3600*8]; NSDateFormatter *formatter3 = [[NSDateFormatter alloc] init]; [formatter3 setTimeZone:timeZone3]; [formatter3 setDateFormat:@&qu 阅读全文
posted @ 2012-06-05 14:28 tx天翔 阅读(3453) 评论(0) 推荐(0) 编辑
摘要: CGRect frame; MyButton *btn = [[MyButton buttonWithType:UIButtonTypeCustom] retain]; btn.index = i; btn.value = [NSString stringWithFormat:@"name%d",i]; NSString *named = [array objectAtIndex:i]; NSURL *url2 = [NSURL URLWithString:named]; UIImage *img = [UIImage imageWithData:[NSData dataW 阅读全文
posted @ 2012-06-05 12:26 tx天翔 阅读(2103) 评论(0) 推荐(0) 编辑
摘要: ActionSheet、AlertView、Slider、Switch的简单使用方法如下:- (IBAction)buttonPressed:(id)sender { UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Are you sure" delegate:self cancelButtonTitle:@"No way" destructiveButtonTitle:@"Yes,I'm sure!" otherButtonTitles: 阅读全文
posted @ 2012-06-05 11:42 tx天翔 阅读(952) 评论(0) 推荐(0) 编辑
摘要: 翻转时,要计算好。如下是6个button的翻转中 frame 的改变- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{ if (toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {/ 阅读全文
posted @ 2012-06-05 11:07 tx天翔 阅读(460) 评论(0) 推荐(0) 编辑
摘要: 方法:1、手势(触背景)关闭键盘-(void)tapBackground //在ViewDidLoad中调用{ UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@sel... 阅读全文
posted @ 2012-06-05 10:58 tx天翔 阅读(9071) 评论(2) 推荐(1) 编辑
摘要: 导航控制器可以用几种不同的风格来显示自身。默认风格就是标准的灰色外观。目前支持三种不同的风格。风 格描 述UIBarStyleDefault默认风格;灰色背景,白色文字UIBarStyleBlack纯黑色背景,白色文字UIBarStyleBlackOpaque纯黑色背景,白色文字 UIBarStyleBlackTranslucent透明黑色背景,白色文字风格是通过barStyle属性来设置的。这个属性属于导航控制器,而不是视图控制器,因此在各个视图之间来回切换时,此属性可以保持一致:self.navigationController.navigationBar.barStyle= UIBarS 阅读全文
posted @ 2012-06-05 10:21 tx天翔 阅读(6688) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 下一页