0
我創造了滾動和UIButton的對像下面的代碼:很難滾動了滾動在Xcode 6
- (void)viewDidLoad {
[super viewDidLoad];
myScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 200, 375, 60)];
myScrollView.contentSize = CGSizeMake(375*4, 60);
myScrollView.pagingEnabled = YES;
myScrollView.backgroundColor = [UIColor orangeColor];
myScrollView.userInteractionEnabled = YES;
[self.view addSubview:myScrollView];
for (int i = 0; i < 4 ; i ++) {
UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(75 + 375*i, 0, 300, 60)];
[btn setTitle:[NSString stringWithFormat:@"Button %d",i+1] forState:UIControlStateNormal];
btn.backgroundColor = [UIColor brownColor];
[btn addTarget:self action:@selector(ButtonClick) forControlEvents:UIControlEventTouchUpInside];
[myScrollView addSubview:btn];
}
}
在iPhone 6,滾動視圖變得堅韌滾動,但是當我更換由按鈕標籤,它工作正常。
在iphone 5,5s中,沒關係; 它有什麼問題?
是的,問題已經解決了,但問題是怎麼回事?你能解釋給我,還是給我發郵件([email protected])。我很感激,非常感謝! – FelixMLians 2014-10-20 11:09:22