0
我想在滾動視圖中沿滾動條移動UIImageview。我試過DidScroll代表沿滾動條在滾動視圖中移動圖像
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
static NSInteger previousPage = 0;
NSLog(@"scrolliview= %f",scrollView.contentOffset.x);
[_img_moving setBackgroundColor:[UIColor greenColor]];
_img_moving.frame = CGRectMake(
scrollView.contentOffset.x,
0, 320/2, 10);
}
uiimageview的幀沒有改變。 注意:我的目標是讓綠色的滾動條寬度爲10像素
什麼是您爲scrollview設置的contentOffset? – jay