Initial commit
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
//
|
||||
// FatherController.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 15/10/29.
|
||||
// Copyright © 2015年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import "FatherController.h"
|
||||
|
||||
@interface FatherController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation FatherController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self setNav];
|
||||
|
||||
|
||||
}
|
||||
-(void)setNav{
|
||||
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
btn.frame = CGRectMake(2, 5,47, 44);
|
||||
[btn setBackgroundImage:[UIImage imageNamed:@"arrow_l"] forState:UIControlStateNormal];
|
||||
[btn addTarget: self action: @selector(goBackAction) forControlEvents: UIControlEventTouchUpInside];
|
||||
|
||||
UIBarButtonItem*back=[[UIBarButtonItem alloc]initWithCustomView:btn];
|
||||
self.navigationItem.leftBarButtonItem=back;
|
||||
}
|
||||
- (void)addTitleViewWithTitle:(NSString *)title{
|
||||
|
||||
UILabel*labe=[[UILabel alloc]initWithFrame:CGRectMake(0, 0,100, 44)];
|
||||
labe.text=title;
|
||||
labe.textAlignment=NSTextAlignmentCenter;
|
||||
labe.textColor=[UIColor whiteColor];
|
||||
labe.font = [UIFont systemFontOfSize:19];
|
||||
self.navigationItem.titleView=labe;
|
||||
|
||||
}
|
||||
-(void)goBackAction{
|
||||
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
#pragma mark - Table view data source
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
|
||||
return 0;
|
||||
}
|
||||
- (BOOL)prefersStatusBarHidden
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle
|
||||
{
|
||||
return UIStatusBarStyleLightContent;
|
||||
}
|
||||
|
||||
-(void)showTitle:(NSString*)title messsage:(NSString*)message{
|
||||
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:title message:message delegate:nil cancelButtonTitle:nil otherButtonTitles:nil, nil];
|
||||
NSTimeInterval dismissSeconds=2.0;
|
||||
[alert show];
|
||||
[self performSelector:@selector(dismissAlert:) withObject:alert afterDelay:dismissSeconds];
|
||||
// UIAlertController *alertContorller=[UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
|
||||
// UIAlertAction*cancleAction=[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
|
||||
//
|
||||
// UIAlertAction *sureAction=[UIAlertAction actionWithTitle:@"好的" style:UIAlertActionStyleDefault handler:nil];
|
||||
// [alertContorller addAction:cancleAction];
|
||||
// [alertContorller addAction:sureAction];
|
||||
// [self presentViewController:alertContorller animated:YES completion:nil];
|
||||
}
|
||||
-(void)dismissAlert:(UIAlertView*)alertView{
|
||||
|
||||
[alertView dismissWithClickedButtonIndex:[alertView cancelButtonIndex] animated:YES];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user