KO
|
EN
gitlite — search
Search
#python
#nodejs
#javascript
#deep-learning
#react
#java
#productivity
#garrysmod
#pdf
#website
#kubernetes
#poetry
XHPageControl
★ 53
Open GitHub ↗
一个简洁好用的自定义UIPageControl
Download README (.md)
Explore Similar Repositories
magritte
:
A language for pipe-based programming
Learn-PowerShell-Core-6.0
:
Learn PowerShell Core 6.0, published by Packt
PlyImporter
:
PLY (Polygon File Format) importer for Unity
UCE-Handler
:
调试时捕获程序崩溃,可提供崩溃的类名、方法名、行数、Error Log、Activity 路径、设备信息、应用信息...
Understanding-Financial-Reports-using-Natural-Language-Processing
:
Investigate how mutual funds leverage credit derivatives by studying their routine filings to the SEC using NLP techniques 📈🤑
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
XHPageControl
?
Download (.md)
# XHPageControl [](https://travis-ci.org/oauth2/XHPageControl) [](https://cocoapods.org/pods/XHPageControl) [](https://cocoapods.org/pods/XHPageControl) [](https://cocoapods.org/pods/XHPageControl) ## Example To run the example project, clone the repo, and run `pod install` from the Example directory first. ## Summary The latest version: 0.1.0 A concise and user-friendly custom UIPageControl Please refer to the Swift version:[Swift版本:JJPageControl](https://github.com/zxhkit/JJPageControl) ## Requirements ``` >= iOS 10.0 ``` ## Installation XHPageControl is available through [CocoaPods](https://cocoapods.org). To install it, simply add the following line to your Podfile: ```ruby pod 'XHPageControl' ``` ## Use 将自定义PageControl类拖到项目中,并导入头文件. ``` //创建pageControl XHPageControl *pageControl = [[XHPageControl alloc] initWithFrame:CGRectMake(0, 300,[UIScreen mainScreen].bounds.size.width, 30)]; //设置点的总个数 pageControl.numberOfPages = 7; //设置非选中点的大小(宽度和高度) pageControl.otherPointSize = CGSizeMake(12, 6); //设置选中点的大小(宽度和高度) pageControl.currentPointSize = CGSizeMake(24, 6); //设置圆角大小 pageControl.pointCornerRadius = 3; //设置两点之间的间隙 pageControl.controlSpacing = 3; //左右间宽,只有在居左居右显示的时候才有用 pageControl.leftAndRightSpacing = 10; //设置样式.默认居中显示 pageControl.pageAliment = PageControlMiddle; //非选中点的颜色 pageControl.otherColor=[UIColor grayColor]; //选中点的颜色 pageControl.currentColor=[UIColor orangeColor]; //当只有一个点的时候是否隐藏,默认隐藏 pageControl. isHidesForSinglePage = YES; //是否可以点击,默认不可以点击 pageControl .isCanClickPoint = YES; //代理 pageControl.delegate = self; //标记 pageControl.tag = 902; [self.view addSubview:pageControl]; ``` 代理实现: ``` #pragma mark - 代理 - (void)xh_PageControlClick:(XHPageControl*)pageControl index:(NSInteger)clickIndex{ NSLog(@"%ld",clickIndex); if(pageControl.tag == 902){ CGPoint position = CGPointMake([UIScreen mainScreen].bounds.size.width * clickIndex, 0); [_scrollView2 setContentOffset:position animated:YES]; } } ``` ## Author zhouxuanhe, 820331062@qq.com ## License XHPageControl is available under the MIT license. See the LICENSE file for more info.