Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To show the login view in navigation based application you should try following instructions :</p> <p>You just need to modify your RootViewController to be a subclass of UIVeiwController instead of UITableViewController, and modify the xib file to have a normal UIView as its view instead of a UITableView.</p> <p>Then put following function to set tabbar:</p> <pre><code>-(void)setTabbar:(UIView *) view { UIButton *btn1,*btn2,*btn3,*btn4,*btn5,*btn6; UIView *tabView; tabView=[[UIView alloc]initWithFrame:CGRectMake(0, 375, 320, 44)]; btn1=[UIButton buttonWithType:UIButtonTypeCustom]; btn1.frame=CGRectMake(0, 0, 53, 44); btn1.tag=1; [btn1 setImage:[UIImage imageNamed:@"b1.png"] forState:UIControlStateNormal]; [btn1 setImage:[UIImage imageNamed:@"b2.png"] forState:UIControlStateSelected]; [btn1 addTarget:self action:@selector(btnTabclick::) forControlEvents:UIControlEventTouchDown]; [tabView addSubview:btn1]; btn2=[UIButton buttonWithType:UIButtonTypeCustom]; btn2.frame=CGRectMake(53, 0, 53, 44); btn2.tag=2; [btn2 setImage:[UIImage imageNamed:@"b1.png"] forState:UIControlStateNormal]; [btn2 setImage:[UIImage imageNamed:@"b2.png"] forState:UIControlStateSelected]; [btn2 addTarget:self action:@selector(btnTabclick::) forControlEvents:UIControlEventTouchDown]; [tabView addSubview:btn2]; btn3=[UIButton buttonWithType:UIButtonTypeCustom]; btn3.frame=CGRectMake(106, 0, 53, 44); btn3.tag=3; [btn3 setImage:[UIImage imageNamed:@"b1.png"] forState:UIControlStateNormal]; [btn3 setImage:[UIImage imageNamed:@"b1.png"] forState:UIControlStateSelected]; [btn3 addTarget:self action:@selector(btnTabclick::) forControlEvents:UIControlEventTouchDown]; [tabView addSubview:btn3]; btn4=[UIButton buttonWithType:UIButtonTypeCustom]; btn4.frame=CGRectMake(159, 0, 55, 44); btn4.tag=4; [btn4 setImage:[UIImage imageNamed:@"b1.png"] forState:UIControlStateNormal]; [btn4 setImage:[UIImage imageNamed:@"b1.png"] forState:UIControlStateSelected]; [btn4 addTarget:self action:@selector(btnTabclick::) forControlEvents:UIControlEventTouchDown]; [tabView addSubview:btn4]; btn5=[UIButton buttonWithType:UIButtonTypeCustom]; btn5.frame=CGRectMake(214, 0, 54, 44); btn5.tag=5; [btn5 setImage:[UIImage imageNamed:@"b1.png"] forState:UIControlStateNormal]; [btn5 setImage:[UIImage imageNamed:@"b2.png"] forState:UIControlStateSelected]; [btn5 addTarget:self action:@selector(btnTabclick::) forControlEvents:UIControlEventTouchDown]; [tabView addSubview:btn5]; btn6=[UIButton buttonWithType:UIButtonTypeCustom]; btn6.frame=CGRectMake(266, 0, 55, 44); btn6.tag=6; [btn6 setImage:[UIImage imageNamed:@"b1.png"] forState:UIControlStateNormal]; [btn6 setImage:[UIImage imageNamed:@"b2.png"] forState:UIControlStateSelected]; [btn6 addTarget:self action:@selector(btnTabclick::) forControlEvents:UIControlEventTouchDown]; [tabView addSubview:btn6]; if (TAG==1) { [btn1 setSelected:YES]; } if (TAG==2) { [btn2 setSelected:YES]; } if (TAG==3) { [btn3 setSelected:YES]; } if (TAG==4) { [btn4 setSelected:YES]; } if (TAG==5) { [btn5 setSelected:YES]; } if (TAG==6) { [btn6 setSelected:YES]; } [view addSubview:tabView]; if ([btnArry count]!=0 || [btnArry retainCount]!=0) { [btnArry release]; } btnArry=[[NSArray alloc]initWithObjects:btn1,btn2,btn3,btn4,btn5,btn6, nil ]; } </code></pre> <p>Then for handling button click event put following function</p> <pre><code>-(IBAction)btnTabclick:(id)sender:(UIView*)view { TAG=[sender tag]; if (TAG==1) { //code to handle click event }else if(TAG==2){ //code to handle click event }else if(TAG==3){ //code to handle click event }else if(TAG==4){ //code to handle click event }else if(TAG==5){ //code to handle click event }else if(TAG==6){ //code to handle click event } } </code></pre> <p>After putting above code in app delegate file just call the settabbar function as follow :</p> <pre><code>[((AppDelegate *)[[UIApplication sharedApplication]delegate]) setTabbar:self.view]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload