views:

389

answers:

1

hi friends, i'm in the middle of developing an application.I have 5 tabs..home,ask,tip,inbox and disclaimer. My problem is regarding horizontal scrolling....say i'm in home view tab which contains an image view showing an human body skeleton...i want to horizontally scroll the home tab which takes me to another view containing a red color button. When i Press that button,it should take me directly to "ASK" tab.

+1  A: 

I'm not sure if I understand the question completely. My guess is that you probably want to get touch events in the image view (home) and detect a horizontal swipe. Then you programatically go to another view with a button and then that button press could simulate a tab press.

mahboudz
is this code what u talking about- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch=[[event allTouches]anyObject]; location1=[touch locationInView:touch.view]; NSLog(@"%f",location1.x);}- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch=[[event allTouches]anyObject]; location2=[touch locationInView:touch.view]; if(location2.x<location1.x }if yes,then plz help with the rest of the code
abhinav
It's best if you look at Apple's MoveMe sample. Go here for more info: http://stackoverflow.com/questions/1138290/how-can-i-move-around-and-slide-away-a-uiview-with-touches-and-swipes/1138380#1138380
mahboudz