change the height of the frame to 200 And then it will work:
segment.frame=CGRectMake(0, 0, 300, 200) ;
Reason: Your height of the view is less when compared.
Question
Recently i tried to create a custom segmentedControl where i had three views in it.
WHILE I WAS TOUCHING FIRST HALF OF THE VIEW THE tapGesture WORKED. But the rest half dint respond.
My frame of the segment is:
segment.frame=CGRectMake(0, 0, 300, 100) ;
And the frame of the UIView is:
view1 = [[UIView alloc]initWithFrame:CGRectMake(10, 80, 100, 40)];
Solution
change the height of the frame to 200 And then it will work:
segment.frame=CGRectMake(0, 0, 300, 200) ;
Reason: Your height of the view is less when compared.
OTHER TIPS
Put Your view frame like this it will work for you..Because you add Segment with height 100 from y=0, So you can set view frame after y = 100..
view1 = [[UIView alloc]initWithFrame:CGRectMake(10, 110, 100, 40)];