Переглянути джерело

Nothing important

Nothing important
MJLee 11 роки тому
батько
коміт
243301aee5

BIN
MJRefreshExample/MJRefreshExample.xcodeproj/project.xcworkspace/xcuserdata/mj.xcuserdatad/UserInterfaceState.xcuserstate


+ 6 - 1
MJRefreshExample/MJRefreshExample/Classes/Controller/MJCollectionViewController.m

@@ -151,6 +151,11 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell
 - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
 {
     MJTestViewController *test = [[MJTestViewController alloc] init];
-    [self.navigationController pushViewController:test animated:YES];
+    if (indexPath.row % 2) {
+        [self.navigationController pushViewController:test animated:YES];
+    } else {
+        UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:test];
+        [self presentViewController:nav animated:YES completion:nil];
+    }
 }
 @end

+ 6 - 3
MJRefreshExample/MJRefreshExample/Classes/Controller/MJTableViewController.m

@@ -62,8 +62,6 @@ - (void)dealloc
     NSLog(@"MJTableViewController--dealloc---");
 }
 
-
-
 /**
  *  集成刷新控件
  */
@@ -146,7 +144,12 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
 {
     MJTestViewController *test = [[MJTestViewController alloc] init];
-    [self.navigationController pushViewController:test animated:YES];
+    if (indexPath.row % 2) {
+        [self.navigationController pushViewController:test animated:YES];
+    } else {
+        UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:test];
+        [self presentViewController:nav animated:YES completion:nil];
+    }
 }
 
 //- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section

+ 7 - 0
MJRefreshExample/MJRefreshExample/Classes/Controller/MJTestViewController.m

@@ -19,6 +19,13 @@ - (void)viewDidLoad
     [super viewDidLoad];
     
     self.title = @"测试控制器";
+    
+    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"关闭" style:UIBarButtonItemStyleDone target:self action:@selector(close)];
+}
+
+- (void)close
+{
+    [self dismissViewControllerAnimated:YES completion:nil];
 }
 
 @end

+ 36 - 23
README.md

@@ -1,30 +1,43 @@
-MJRefresh
-=========
-
+## MJRefresh
+---
 The easiest way to use pull-to-refresh
 
 ![(52326ce26803fabc46000000_18)](http://code4app.qiniudn.com/photo/52326ce26803fabc46000000_18.gif)
 
-MJ友情提示
------------
-### 1.添加头部控件的方法
-     [self.tableView addHeaderWithTarget:self action:@selector(headerRereshing)];
-     或者
-     [self.tableView addHeaderWithCallback:^{ }];
- 
-### 2.添加尾部控件的方法
-     [self.tableView addFooterWithTarget:self action:@selector(footerRereshing)];
-     或者
-     [self.tableView addFooterWithCallback:^{ }];
- 
-### 3.可以在MJRefreshConst.h和MJRefreshConst.m文件中自定义显示的文字内容和文字颜色
+### 添加头部控件
+---
+```objc
+[self.tableView addHeaderWithTarget:self action:@selector(headerRereshing)];
+```
+或者
+```objc
+[self.tableView addHeaderWithCallback:^{ }];
+```
  
-### 4.本框架兼容iOS6\iOS7,iPhone\iPad横竖屏
+### 添加尾部控件
+---
+```objc
+[self.tableView addFooterWithTarget:self action:@selector(footerRereshing)];
+```
+或者
+```objc
+[self.tableView addFooterWithCallback:^{ }];
+```
+
+### 自动进入刷新状态
+---
+```objc
+[self.tableView headerBeginRefreshing];
+[self.tableView footerBeginRefreshing];
+```
  
-### 5.自动进入刷新状态
-    [self.tableView headerBeginRefreshing];
-    [self.tableView footerBeginRefreshing];
+### 结束刷新
+---
+```objc
+[self.tableView headerEndRefreshing];
+[self.tableView footerEndRefreshing];
+```
+
+### 可以在MJRefreshConst.h和MJRefreshConst.m文件中自定义显示的文字内容和文字颜色
  
-### 8.结束刷新
-    [self.tableView headerEndRefreshing];
-    [self.tableView footerEndRefreshing];
+### 本框架兼容的系统>=iOS6.0,iPhone\iPad横竖屏