Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PGPickerView是将UIPickerView的弯曲弧度变成直列表,可以是单列表,多列表,还可以修改选中label的字体颜色等。

License

Notifications You must be signed in to change notification settings

wmh8638/PGPickerView

Repository files navigation

PGPickerView

PGPickerView是将UIPickerView的弯曲弧度变成直列表,可以是单列表,多列表,还可以修改选中label的字体颜色等,用法跟UIPickerView一样。

CocoaPods compatible

PGPickerView.gif

内置3中样式

样式一

样式一

样式二

样式一

样式三

样式一

显示中间字

middle

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查看

许可证

PGPickerView 使用 MIT 许可证,详情见 LICENSE 文件。

About

PGPickerView是将UIPickerView的弯曲弧度变成直列表,可以是单列表,多列表,还可以修改选中label的字体颜色等。

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 98.7%
  • Ruby 1.3%

AltStyle によって変換されたページ (->オリジナル) /