Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xiaozhuxiong121/pgpickerview
PGPickerView是将UIPickerView的弯曲弧度变成直列表,可以是单列表,多列表,还可以修改选中label的字体颜色等。
https://github.com/xiaozhuxiong121/pgpickerview
cocoapods objective-c pickerview swift uipickerview
Last synced: 2 days ago
JSON representation
PGPickerView是将UIPickerView的弯曲弧度变成直列表,可以是单列表,多列表,还可以修改选中label的字体颜色等。
- Host: GitHub
- URL: https://github.com/xiaozhuxiong121/pgpickerview
- Owner: xiaozhuxiong121
- License: mit
- Created: 2017-07-31T06:11:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-03T02:23:45.000Z (almost 6 years ago)
- Last Synced: 2024-10-18T16:20:02.055Z (29 days ago)
- Topics: cocoapods, objective-c, pickerview, swift, uipickerview
- Language: Objective-C
- Homepage:
- Size: 1.11 MB
- Stars: 222
- Watchers: 2
- Forks: 33
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PGPickerView
PGPickerView是将UIPickerView的弯曲弧度变成直列表,可以是单列表,多列表,还可以修改选中label的字体颜色等,用法跟UIPickerView一样。
![](01F3FA58-E2F9-4BFF-9F49-F07BD32322DD.png)[![CocoaPods compatible](https://img.shields.io/cocoapods/v/PGPickerView.svg)](https://cocoapods.org/pods/PGPickerView)
![](https://img.shields.io/badge/platform-iOS-red.svg) ![](https://img.shields.io/badge/language-Objective--C-orange.svg)
![](https://img.shields.io/badge/license-MIT%20License-brightgreen.svg)
[![](https://img.shields.io/badge/jianshu-piggybear-red.svg)](http://www.jianshu.com/u/3740632b2002)![PGPickerView.gif](PGPickerView.gif)
> 内置3中样式
# 样式一
![样式一](Images/type1.png)# 样式二
![样式一](Images/type2.png)# 样式三
![样式一](Images/type3.png)# 显示中间字
![middle](Images/middle.png)# CocoaPods安装
```
pod 'PGPickerView', '>= 1.2.1'
```# 使用
```
PGPickerView *pickerView = [[PGPickerView alloc]initWithFrame:self.view.bounds];
pickerView.delegate = self;
pickerView.dataSource = self;
[self.view addSubview:pickerView];#pragma PGPickerViewDataSource
- (NSInteger)numberOfComponentsInPickerView:(PGPickerView *)pickerView {
return 2;
}- (NSInteger)pickerView:(PGPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
return 10;
}
#pragma PGPickerViewDelegate
- (nullable NSString *)pickerView:(PGPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
return [NSString stringWithFormat:@"label%ld--%ld", component, row];
}
```
# 设置样式
```
//设置线条的颜色
pickerView.lineBackgroundColor = [UIColor redColor];
//设置选中行的字体颜色
pickerView.textColorOfSelectedRow = [UIColor blueColor];
//设置未选中行的字体颜色
pickerView.textColorOfOtherRow = [UIColor blackColor];```
**更多的使用方法请下载[demo](https://github.com/xiaozhuxiong121/PGPickerView)查看**
# 许可证
PGPickerView 使用 MIT 许可证,详情见 [LICENSE](LICENSE) 文件。