【发布时间】:2012-05-26 00:26:20
【问题描述】:
我创建了一个分段控制器,它具有不同大小的段。 当我检查时,我看到段控制器具有不同宽度大小的段,但是当我尝试触摸最大的段时,它只能在段的左侧被触摸。 (可能只是前 50 px 部分,但段是 160 px)。如何设置段的可触摸区域?
//My header file:
#import <UIKit/UIKit.h>
@interface Form1 : UIViewController <UIAlertViewDelegate>{
IBOutlet UISegmentedControl *combobox6001;
}
@property (nonatomic, strong) IBOutlet UISegmentedControl *combobox6001;
@end
#import "Form1.h"
@implementation Form1
@synthesize combobox6001;
- (void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[combobox6001 setWidth:50 forSegmentAtIndex:0];
[combobox6001 setWidth:50 forSegmentAtIndex:1];
[combobox6001 setWidth:160 forSegmentAtIndex:2];
}
【问题讨论】:
标签: ios touch uisegmentedcontrol