原创 使用ScrollView縮放圖片

ViewController.h @interface ViewController : UIViewController<UIScrollViewDelegate> { UIScrollView *_scrollView; }V

原创 二次封裝CoreData

(1)創建一個Data Model文件,命名爲MyModel.xcdatamodeld (2)創建Users表,添加如圖的字段 (3)創建NSManagedObject subclass表實體文件 (4)在Users.m文件中,覆寫des

原创 新浪微博的簡易框架【主題選中特效】

在AppDelegate.m中設置根視圖控制器 RootviewController.h @interface RootTabbarController : UITabBarController { UIImageView *_s

原创 輕掃手勢/平移、長按手勢

(1)創建故事板 (2)在ViewController.h中設置全局_myView (3)ViewController.m #import "ViewController.h" @interface ViewController ()

原创 解釋爲什麼imgView要打開點擊事件【事件響應鏈】

(1)在AppDelegate.m文件中將導航控制器設置爲根控制器 RootViewController *rootCtrl = [[RootViewController alloc] init]; UINavigationCon

原创 表的頭視圖下拉放大效果

ViewController.h @interface ViewController : UIViewController<UITableViewDelegate,UITableViewDataSource> { UIImage

原创 展示圖

ViewController.h @interface ViewController : UIViewController<UIScrollViewDelegate> { UIPageControl *_pageCtrl;

原创 事件響應鏈

(1)設置根視圖控制器 (2)RootViewController.m - (void)viewDidLoad { [super viewDidLoad]; MyView *view = [[MyView alloc]

原创 電話本的檢索功能

設置帶有導航欄的根視圖控制器 RootViewController.h @interface RootViewController : UIViewController<UITableViewDataSource,UITableViewD

原创 單元格的三種定製方式

AppDelegate.m MainViewController *mainCtrl = [[MainViewController alloc] initWithStyle:UITableViewStylePlain];

原创 UIScrollView 的常用屬性

ViewController.h @interface ViewController : UIViewController<UIScrollViewDelegate>ViewController.m#import "ViewControl

原创 QQ列表的展開收起

RootViewController.h @interface RootViewController : UIViewController<UITableViewDataSource,UITableViewDelegate> {

原创 點擊按鈕切換圖片

RootViewController.m - (void)viewDidLoad { [super viewDidLoad]; _imageView.image = [UIImage imageNamed:@"1"];

原创 簡易圖片瀏覽器【可縮放圖片,滑動後恢復正常】

AppDelegate.h #import "AppDelegate.h" #import "RootViewController.h" @implementation AppDelegate - (BOOL)application:

原创 漸變式切換圖片

ViewController.h @interface ViewController : UIViewController<UIScrollViewDelegate> { UIImageView *imageView1;