Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-05-2011, 04:34 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2011
Posts: 6
AlexK is on a distinguished road
Default Question about switching visible tab using a button

In a tab bar application using the bottom bar lets you switch views. Is there a way to create a button on one page that will duplicate this effect?



My goal is that clicking the "to second page" button or clicking on the tab that says "second" at the bottom will have the same effect.
AlexK is offline   Reply With Quote
Old 07-05-2011, 05:06 PM   #2 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

Not that familiar with UITabBarControllers but you could try setting the selectedViewController property.
Domele is offline   Reply With Quote
Old 07-05-2011, 05:23 PM   #3 (permalink)
Registered Member
 
Join Date: Feb 2011
Posts: 97
Bopols is on a distinguished road
Default

Quote:
Originally Posted by AlexK View Post
In a tab bar application using the bottom bar lets you switch views. Is there a way to create a button on one page that will duplicate this effect?



My goal is that clicking the "to second page" button or clicking on the tab that says "second" at the bottom will have the same effect.
tabbar.selectedIndex = 1
Bopols is offline   Reply With Quote
Old 07-05-2011, 05:23 PM   #4 (permalink)
Registered Member
 
Join Date: Jun 2011
Posts: 6
AlexK is on a distinguished road
Default

Quote:
Originally Posted by Domele View Post
Not that familiar with UITabBarControllers but you could try setting the selectedViewController property.
this didnt quite work but it put me on the right track.

I found this works, it'll switch the view to the second tab (0 being first tab):
Code:
self.tabBarController.selectedIndex = 1;
AlexK is offline   Reply With Quote
Reply

Bookmarks

Tags
switching views, tab bar

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 352
9 members and 343 guests
apatsufas, chemistry, lendo, leostc, Leslie80, lzwasyc, MarkC, SamorodovAlex, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:34 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0