- 博客(10)
- 资源 (3)
- 收藏
- 关注
原创 使用tableView中的cell来实现单选效果
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ NSArray *array = [tableView visibleCells]; for (UITableViewCell *cellin array) {// 不打对勾
2015-09-25 16:45:12 2942
原创 tableView 和聊天对话一样,显示最新的数据,不用滑动
在viewController.h文件中@property (nonatomic) NSInteger dataSource;@property (nonatomic) UITableView *chatTableView;在viewController.m文件中- (void)viewDidAppear:(BOOL)animated { [sup
2015-09-16 12:13:31 976
原创 隐藏自定义的tabBar
隐藏自定义的tabBar:在viewController.m文件中写入以下代码。-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{ self = [superinitWithNibName:nibNameOrNil bun
2015-09-16 11:59:46 439
原创 iOS 登录页面跳转到首页(含有tabBar)
自定义tabBar类在customTabBarCtrl.h中#import <UIKit/UIKit.h> @interface customTabBarCtrl : UITabBarController@end在customTabBarCtrl.m中#import "customTabBarCtrl.h"#import "mainViewContr...
2015-09-07 15:20:44 3124
原创 解决 " 登录页面(没有导航栏)跳转到下一页面(有导航栏) " 问题
如果登录页面为根视图,下面可以这么写。在appDelegate.m中loginViewController *loginVC = [[loginViewController alloc]init];UINavigationController *navigationController = [[UINavigationController alloc]initWith
2015-09-07 15:11:27 4612
原创 输入框被键盘遮挡问题
//开始编辑输入框的时候,软键盘出现,执行此事件-(void)textFieldDidBeginEditing:(UITextField *)textField{CGRect frame = textField.frame;int offset = frame.origin.y + 100 - (Height - 360.0);//键盘高度NSTimeInterval animat
2015-09-06 20:21:21 875
原创 iOS 如何开启和关闭定时器
先在.h文件定义一个全局变量@property(nonatomic) NSTimer *timer;在.m文件中//定时器_timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(update) userInfo:nil repeats:YES];//关闭定时器[...
2015-09-06 16:59:03 1257
原创 定时器
在.h文件@property(nonatomic)UILabel *countDownLabel;@property(nonatomic)NSTimer *timer;@property(nonatomic,assign)int second;在.m文件- (void)viewDidLoad {_second = 120;
2015-09-06 16:49:03 439
原创 navigationController隐藏问题
navigationController还有很多解决隐藏的方法,这里我就先举一种。-(void)viewWillAppear:(BOOL)animated{ self.navigationController.navigationBarHidden = YES;}
2015-09-01 17:38:42 583
原创 button上的图片显示蓝色
UIButton *headImg = [UIButtonbuttonWithType:UIButtonTypeCustom];headImg.frame =CGRectMake((UISCREEN_WIDTH-60)/2,5, 60, 60);[headImgsetImage:[UIImageimageNamed:@"我的.png"]forState:UI
2015-09-01 15:05:35 1431
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人