日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

scrollview背景

發(fā)布時(shí)間:2025/4/14 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 scrollview背景 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

?

當(dāng)scrollview不設(shè)置背景色時(shí),拖動(dòng)scrollview上的內(nèi)容,邊界顯示view的背景色。

當(dāng)scrollview設(shè)置背景色時(shí),拖動(dòng)scrollview上的內(nèi)容,邊界顯示scrollview的背景色

用兩種顏色時(shí),可以在scrollview上再添加一層,如黃色的view。

?

滑動(dòng)屬性:

 _scrollView.pagingEnabled = YES; //只能按頁滑動(dòng),設(shè)置為NO時(shí)可以連續(xù)滑動(dòng)
?? _scrollView.bounces = YES; //可以打開頂部的間隔,松開后,又彈回去了。 如果bounds設(shè)置為NO,則打不開下拉刷新

?

?

- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view, typically from a nib.//CGFloat w = self.view.frame.size.width;//CGFloat h = self.view.frame.size.height;int w = self.view.bounds.size.width;int h = self.view.bounds.size.height;self.view.backgroundColor = [UIColor redColor];_scrollView = [[UIScrollView alloc]initWithFrame:self.view.frame];_scrollView.backgroundColor = [UIColor blueColor];[self.view addSubview:_scrollView];UIView *view = [[UIView alloc]initWithFrame:self.view.frame];[_scrollView addSubview: view];view.backgroundColor = [UIColor yellowColor];for(int i = 0;i< kCount;i++){NSString *name = [NSString stringWithFormat:@"%02d.jpg",i+1];UILabel *label = [[UILabel alloc] init];label.frame = CGRectMake(i*w, 0, w, h);label.text = name;[view addSubview:label];}_scrollView.userInteractionEnabled = YES;_scrollView.contentSize = CGSizeMake(kCount*w, 800);// height == 0 代表 禁止垂直方向滾動(dòng)_scrollView.scrollEnabled = YES;_scrollView.pagingEnabled = YES;_scrollView.delegate = self;}

IOS開發(fā): 為UIImageView添加點(diǎn)擊事件

?

轉(zhuǎn)載于:https://www.cnblogs.com/dqxu/p/4024921.html

總結(jié)

以上是生活随笔為你收集整理的scrollview背景的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。