随笔分类 - iOS系统控件使用
记录早期学习iOS时分析使用系统控件
摘要:一、检测捏合手势( UIPinchGestureRecognizer): //设定一个实例变量存储手指之间的其起始距离 @property (assign, nonatomic) CGFloat initialFontSize; //调用: UIPinchGestureRecognizer *pin
阅读全文
摘要:记录于2013/7/4 加入框架: MobileCoreServices.framework MediaPlayer.framework 导入头文件: #import <MediaPlayer/MediaPlayer.h> #import <MobileCoreServices/UTCoreType
阅读全文
摘要:闲来无事便在网上google&baidu了一番UINavigationController的相关文章,然后又看了下官方文档;看看更新到iOS7之后UINavigationController的是否有变化,同时也再温故下UINavigationController的使用0.0 平时都是用的自定义的导航
阅读全文
摘要:有关UICollectionView的几篇文章:1、UICollectionView简介及简单示例: http://puttin.github.io/blog/2013/04/08/a-simple-uicollectionview-tutorial/2、WWDC 2012 Session笔记—205 Introducing Collection Views: http://www...
阅读全文
摘要:注意: 1、需要在ios6.0之后的版本中使用 2、UIRefreshControl目前只能用于UITableViewController,如果用在其他ViewController中,运行时会错误(即UIRefreshControl只能被UITableViewController管理) UIRefr
阅读全文
摘要:下面这段代码配合xib使用, 不过关键不在这地方,记住后面的使用到的委托。 其实质就是数组array的删除操作。
阅读全文
摘要:基本思想:点击进入编辑模式进行操作,以一个NSarray作为存储容器,增删操作对象即是NSArray 具体代码如下 实例运用:
阅读全文
摘要:(2.) 数组: Cocoa 使用 NSArray 表示数组,但是它不能存储基本数据类型、enum、struct、nil,只能存 储 Objective-C 的对象。 例: NSArray *array=[NSArray arrayWithObjects: @"One", @"Two", @"Thr
阅读全文
摘要:自定义TabBar的高度:(无论横屏还是竖屏都以竖屏为准,之前就改为横屏的设置出错,找了好久才找到这个问题) 如何隐藏UITabBar 已经如何使已经隐藏的TabBar重现(原创): http://www.cnblogs.com/moshengren/archive/2010/10/18/18552
阅读全文
摘要:官方文档:UITabBarController Class Reference:https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITabBarController_Class/Reference/Reference.htmlUITabBarItem Class Reference:https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITabBarItem_Class/Reference/Reference.h
阅读全文
摘要:用于显示临时内容,特点是总是显示在当前视图最前端,当单击界面的其他地方时自动消失。 弹出框其实可以设定为另一个界面了: eg:点击按钮触发clickButton事件: 也可以实现列表格式,就如下图的所示样子: 官方文档: UIPopoverController Class Reference htt
阅读全文
摘要://先定义一个变量值BOOL isProgressShow;-(void)buttonClicked{ if (isProgressShow) { [activityIndicatorView stopAnimating]; }else{ [activityIndicatorView startAnimating]; } isProgressShow = !isProgressShow;}- (void)viewDidLoad{ [super viewDidLoad]; UIView *contentView = [[UI...
阅读全文
摘要://初始化AlertViewUIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"AlertViewTest" message:@"message" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OtherBtn",nil]; //...
阅读全文
摘要:1.。效果图:分别为有短信分享 无短信分享-(void)viewDidLoad{ //添加按钮 UIButton *shareButton = [[UIButton alloc] initWithFrame:CGRectMake(100, 100, 100, 50)]; [shareButton setBackgroundColor:[UIColor redColor]]; [shareButton addTarget:self action:@selector(shareButtonPressed) forControlEvents...
阅读全文
摘要://高度可调且有一个显示更多的按钮-(void)viewDidLoad{ UITableView* table=[[UITableView alloc]initWithFrame:CGRectMake(0, 44, 320, 416)]; table.delegate=self; table.dat
阅读全文
摘要:1.点击按钮触发allcountry事件:-(void)allcoutry{ //界面设计 picker_background=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; UIImageView *navigationItem=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"SchoolSearch_AllPleace_navBar.png"]]; navigationItem.frame=CGRectMake(0, 0, 320,..
阅读全文
摘要:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. /*********按钮控件UIButton**********/ UIButton *myButton = [UIButtonbuttonWithType:UIButtonTypeRoundedRect]; //按钮风格,6种 myButton.frame = CGRectMake(25.0, 25.0, 100.0, 100...
阅读全文
摘要://UISlider触发的动作-(void)sliderValueChanged:(id)sender{ UISlider *control = (UISlider *)sender; if (control == mySlider) { float value = control.value; /*添加代码,对滑块的值做出响应*/ } }-(void)viewDidLoad{ /***********滑块控件UISlider**************/ //创建控件 UISl...
阅读全文
摘要://UISwitch触发的动作-(void)switchStatusChanged:(id)sender{ UISwitch *control = (UISwitch *)sender; if (control == mySwitch) { BOOL ison = control.on; /*添加代码,处理开关的状态*/ }}-(void)viewDidLoad{ /*************开关控件UISwitch**************/ //创建控件 UISwitch *aSwitch = [UISwitch alloc...
阅读全文
摘要:-(void) viewDidLoad{ /*************分段控件UISegmentdControl*************/ UISegmentedControl *segmentedControl = [[UISegmentedControlalloc] initWithItems:nil]; segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar; //控件风格小按钮,适合导航栏: segmentedControl.segmentedControlStyle = UISegme...
阅读全文