1 除了调用相应控件的resignFirstResponder方法外,还有另外三种办法: 2 重载UIViewController中的touchesBegin方法,然后在里面执行在[self.view endEditing:YES];这样单击UIViewController的任意地方,就可以收起键盘 ...
分类:
其他好文 时间:
2016-04-29 21:58:10
阅读次数:
166
一 可以为类添加新功能
UIViewController
extension UIViewController {
// 为 UIViewController 添加的新功能写到这里
}
Double
extension Double {
var km: Double { return self * 1_000.0 }
var m : Double { return self...
分类:
编程语言 时间:
2016-04-29 18:46:26
阅读次数:
127
- (UIViewController *)viewController {
//通过响应者链,取得此视图所在的视图控制器
UIResponder *next = self.nextResponder;
do {
//判断响应者对象是否是视图控制器类型
if ([next isKindOfClass:[UIViewC...
分类:
移动开发 时间:
2016-04-29 16:24:54
阅读次数:
172
iOS8之后,有了UIAlertController这个类,如下 NS_CLASS_AVAILABLE_IOS(8_0) @interface UIAlertController : UIViewController 很明显,苹果强烈建议广大码农们如果能不用UIAlertView就不要用啦,因为我 ...
分类:
其他好文 时间:
2016-04-28 16:59:26
阅读次数:
156
iOS8之后,有了UIAlertController这个类,如下 NS_CLASS_AVAILABLE_IOS(8_0) @interface UIAlertController : UIViewController 很明显,苹果强烈建议广大码农们如果能不用UIAlertView就不要用啦,因为我 ...
分类:
其他好文 时间:
2016-04-27 22:17:07
阅读次数:
753
在多控制器下,要想多个页面隐藏导航栏(push出来的View),可以重写自己的NavigationController : UINavigationController,重写- (void)pushViewController:(UIViewController *)viewController a ...
分类:
其他好文 时间:
2016-04-27 20:31:05
阅读次数:
105
详解CALayer 和 UIView的区别和联系 1.首先UIView可以响应事件,Layer不可以. UIKit使用UIResponder作为响应对象,来响应系统传递过来的事件并进行处理。UIApplication、 UIViewController、UIView、和所有从UIView派生出来的U ...
分类:
其他好文 时间:
2016-04-27 08:15:24
阅读次数:
375
怎么样可以一次性把导航控制器中的返回键全都自定义。 思路: 我们可以在push的时候来设置这个自定义按钮,push有一个方法 - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{} ...
分类:
移动开发 时间:
2016-04-25 22:30:29
阅读次数:
295
一,效果图。 二,工程图。 三,代码。 RootViewController.h #import <UIKit/UIKit.h> @interface RootViewController : UIViewController <UIScrollViewDelegate,UITableViewDel ...
分类:
其他好文 时间:
2016-04-22 09:27:34
阅读次数:
165
一,效果图。
二,工程图。
三,代码。
ViewController.h
#import
#import
#import "MapLocation.h"
@interface ViewController : UIViewController
{
MKMapView *_mapView;
NSString *addressStri...
分类:
其他好文 时间:
2016-04-19 12:11:39
阅读次数:
261