TableView 微信設(shè)置界面

#import <UIKit/UIKit.h>

#import"RootTableViewController.h"

@interfaceAppDelegate :UIResponder

@property(strong,nonatomic)UIWindow*window;

@end

#import"AppDelegate.h"

@interfaceAppDelegate()

@end

@implementationAppDelegate

- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {

// Override point for customization after application launch.

self.window.rootViewController= [[UINavigationControlleralloc]initWithRootViewController:[[RootTableViewControlleralloc]initWithStyle:UITableViewStyleGrouped]];

returnYES;

}

- (void)applicationWillResignActive:(UIApplication*)application {

// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.

// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.

}

- (void)applicationDidEnterBackground:(UIApplication*)application {

// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.

// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.

}

- (void)applicationWillEnterForeground:(UIApplication*)application {

// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.

}

- (void)applicationDidBecomeActive:(UIApplication*)application {

// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.

}

- (void)applicationWillTerminate:(UIApplication*)application {

// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.

}

@end

#import <UIKit/UIKit.h>

@interfaceRootTableViewController :UITableViewController

@property(strong,nonatomic)UITableView*tableV;

@property(strong,nonatomic)NSArray*arrTitle;

@property(strong,nonatomic)NSArray*arrimages;

@end

#import"RootTableViewController.h"

@interfaceRootTableViewController()

@end

@implementationRootTableViewController

- (void)viewDidLoad {

[superviewDidLoad];

self.title=@"我";

self.arrTitle=@[@"相冊(cè)",@"收藏",@"錢包",@"卡包"];

self.arrimages=@[@"MoreMyAlbum@2x",@"MoreMyFavorites",@"MoreMyBankCard@2x",@"PayCarddetailVirtualIcon@2x"];

//重用的唯一標(biāo)識(shí)

[self.tableViewregisterClass:[UITableViewCellclass]forCellReuseIdentifier:@"mycell"];

//取消滑動(dòng)

self.tableView.scrollEnabled=NO;

//設(shè)置分隔符的樣式

self.tableV.separatorStyle=UITableViewCellSeparatorStyleNone;

//設(shè)置導(dǎo)航欄的前景色

self.navigationController.navigationBar.titleTextAttributes=@{NSForegroundColorAttributeName:[UIColorcolorWithRed:0.135green:0.098blue:0.104alpha:1.000]};

}

- (void)didReceiveMemoryWarning {

[superdidReceiveMemoryWarning];

// Dispose of any resources that can be recreated.

}

#pragma mark - Table view data source

//顯示分區(qū)

- (NSInteger)numberOfSectionsInTableView:(UITableView*)tableView {

return4;

}

//顯示每個(gè)分區(qū)的內(nèi)容數(shù)量

- (NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section {

if(section ==0) {

return1;

}elseif(section ==1){

return4;

}else{

return1;

}

}

- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath {

UITableViewCell*cell = [tableViewdequeueReusableCellWithIdentifier:@"mycell"forIndexPath:indexPath];

if(indexPath.section==0) {

//設(shè)置邊框的數(shù)量

cell.textLabel.numberOfLines=2;

cell.imageView.image= [UIImageimageNamed:@"a.jpeg"];

cell.textLabel.text=@"飛魚\r\n微信號(hào):lcj556611";

cell.imageView.backgroundColor= [UIColorredColor];

//獲取二維碼圖片

UIImage*img = [UIImageimageNamed:@"微信"];

UIImageView*imgV = [[UIImageViewalloc]initWithImage:img];

//啟用用戶交互

imgV.userInteractionEnabled=YES;

[imgVsetFrame:CGRectMake(0,350,40,40)];

cell.accessoryView= imgV;

}

elseif(indexPath.section==1){

cell.textLabel.text=self.arrTitle[indexPath.row];

cell.imageView.image= [UIImageimageNamed:self.arrimages[indexPath.row]];

}elseif(indexPath.section==2){

cell.textLabel.text=@"表情";

cell.imageView.image= [UIImageimageNamed:@"MoreExpressionShops"];

cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;

}else{

cell.textLabel.text=@"設(shè)置";

cell.imageView.image= [UIImageimageNamed:@"MoreSetting"];

cell.accessoryType=1;

}

returncell;

}

//設(shè)置行高

-(CGFloat)tableView:(UITableView*)tableView heightForRowAtIndexPath:(NSIndexPath*)indexPath

{

if(indexPath.section==0) {

return100;

}

return40;

}

/*

// Override to support conditional editing of the table view.

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {

// Return NO if you do not want the specified item to be editable.

return YES;

}

*/

/*

// Override to support editing the table view.

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {

if (editingStyle == UITableViewCellEditingStyleDelete) {

// Delete the row from the data source

[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];

} else if (editingStyle == UITableViewCellEditingStyleInsert) {

// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view

}

}

*/

/*

// Override to support rearranging the table view.

- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {

}

*/

/*

// Override to support conditional rearranging of the table view.

- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {

// Return NO if you do not want the item to be re-orderable.

return YES;

}

*/

/*

#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

// Get the new view controller using [segue destinationViewController].

// Pass the selected object to the new view controller.

}

*/

@end

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市谅猾,隨后出現(xiàn)的幾起案子顶掉,更是在濱河造成了極大的恐慌水泉,老刑警劉巖,帶你破解...
    沈念sama閱讀 218,607評(píng)論 6 507
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件虚循,死亡現(xiàn)場(chǎng)離奇詭異猎物,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)淮椰,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,239評(píng)論 3 395
  • 文/潘曉璐 我一進(jìn)店門五慈,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人主穗,你說我怎么就攤上這事泻拦。” “怎么了忽媒?”我有些...
    開封第一講書人閱讀 164,960評(píng)論 0 355
  • 文/不壞的土叔 我叫張陵争拐,是天一觀的道長(zhǎng)。 經(jīng)常有香客問我晦雨,道長(zhǎng)架曹,這世上最難降的妖魔是什么灯抛? 我笑而不...
    開封第一講書人閱讀 58,750評(píng)論 1 294
  • 正文 為了忘掉前任,我火速辦了婚禮音瓷,結(jié)果婚禮上对嚼,老公的妹妹穿的比我還像新娘。我一直安慰自己绳慎,他們只是感情好纵竖,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,764評(píng)論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著杏愤,像睡著了一般靡砌。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上珊楼,一...
    開封第一講書人閱讀 51,604評(píng)論 1 305
  • 那天通殃,我揣著相機(jī)與錄音,去河邊找鬼厕宗。 笑死画舌,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的已慢。 我是一名探鬼主播曲聂,決...
    沈念sama閱讀 40,347評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼佑惠!你這毒婦竟也來了朋腋?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,253評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤膜楷,失蹤者是張志新(化名)和其女友劉穎旭咽,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體赌厅,經(jīng)...
    沈念sama閱讀 45,702評(píng)論 1 315
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡穷绵,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,893評(píng)論 3 336
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了察蹲。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片请垛。...
    茶點(diǎn)故事閱讀 40,015評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖洽议,靈堂內(nèi)的尸體忽然破棺而出宗收,到底是詐尸還是另有隱情,我是刑警寧澤亚兄,帶...
    沈念sama閱讀 35,734評(píng)論 5 346
  • 正文 年R本政府宣布混稽,位于F島的核電站,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏匈勋。R本人自食惡果不足惜礼旅,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,352評(píng)論 3 330
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望洽洁。 院中可真熱鬧痘系,春花似錦、人聲如沸饿自。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,934評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)复唤。三九已至烛卧,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間总放,已是汗流浹背呈宇。 一陣腳步聲響...
    開封第一講書人閱讀 33,052評(píng)論 1 270
  • 我被黑心中介騙來泰國(guó)打工攒盈, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留抵拘,地道東北人哎榴。 一個(gè)月前我還...
    沈念sama閱讀 48,216評(píng)論 3 371
  • 正文 我出身青樓尚蝌,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親充尉。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,969評(píng)論 2 355

推薦閱讀更多精彩內(nèi)容