UIScrollView中添加了一个手势 UITapGestureRecognizer *_tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(foregroundTapped:)]...
分类:
移动开发 时间:
2014-09-12 11:39:13
阅读次数:
184
文件类型AppDelegate.m#import"AppDelegate.h"
#import"MainViewController.h"
@implementationAppDelegate
-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
self.window=[[UIWindowalloc]initWithFrame:[[UIScr..
分类:
其他好文 时间:
2014-09-10 09:42:20
阅读次数:
241
UITableViewDataSource 协议中常用方法
1.设置右边索引值
- (NSArray *)sectionIndexTitlesForTableView:(UITableView
*)tableView
2.设置分组标识
- (NSString *)tableView:(UITableView
*)tableView titleForHeaderInSecti...
分类:
移动开发 时间:
2014-09-09 16:13:58
阅读次数:
175
新建一个UITableView的子类,在其中实现UITableView创建的代理步骤,唯一不同是需要建一个属性数组,用来传递数据然后再ViewController初始化并设置正确的代理对象此方法适用同一个界面多个UITableView使用,好管理数据
分类:
其他好文 时间:
2014-09-09 10:48:58
阅读次数:
220
-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath{//重用标识符staticNSString*identifider=@"reuse";//去重用队列中根据标识符取可重用的cellAddressBookCell*cell=[tableViewdequeueReusableCellWithIdentifier:identifi..
分类:
其他好文 时间:
2014-09-05 03:24:31
阅读次数:
208
写代码有时和说话一样,要体现层次感,可能是首先罗列要点,然后再逐点 细化。但如果时而说要点,时而谈细节,就会造成听者理解上的障碍。如下的代 码就会有这样的一个问题:重构前:- (UITableViewCell *)tableView:(UITableView *)tableView cellForR...
分类:
移动开发 时间:
2014-09-05 00:52:30
阅读次数:
216
最终效果图:
自定义cell的封装
BeyondCell
//
// BeyondCell.h
// 29_仿微信聊天
//
// Created by beyond on 14-9-4.
// Copyright (c) 2014年 com.beyond. All rights reserved.
//
#import
@class Beyo...
分类:
微信 时间:
2014-09-04 22:21:10
阅读次数:
488
//设置行高-(CGFloat)tableView:(UITableView*)tableViewheightForRowAtIndexPath:(NSIndexPath*)indexPath{return80;}//分区-(NSInteger)numberOfSectionsInTableView:(UITableView*)tableView{//Returnthenumberofsections.return3;}//设置每个区有多少行共有多少行-(NSInteg..
分类:
其他好文 时间:
2014-09-04 11:59:50
阅读次数:
221
首先重写UITableViewCell的初始化方法:- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (...
分类:
移动开发 时间:
2014-09-04 09:46:27
阅读次数:
195