去掉UIPickerView的弯曲弧度

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

PGPickerView.gif

GitHub Address

https://github.com/xiaozhuxiong121/PGPickerView

Installation with CocoaPods

pod 'PGPickerView'

Usage

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];
}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • WebSocket-Swift Starscream的使用 WebSocket 是 HTML5 一种新的协议。它实...
    香橙柚子阅读 24,222评论 8 184
  • 一树梨花一片林,梨花片片入秋坟; 花红百日悠悠去,春去秋来落纷纷。
    cab5ad29a304阅读 149评论 0 0
  • 静坐苦思欲乘舟 浮随迷雾奔东流 三峡两岸好景色 自古到今名篇流 泛泛碧水几千许 只取一口润枯心 顿闻江上琴音起 聆...
    微风灬树叶阅读 507评论 0 1
  • ——草原三日之二日。 上篇的“草原三日”之一日,纪录了接触草原的第一天。该不过是凤毛麟角...
    位威阅读 813评论 0 5