GithubHelp home page GithubHelp logo

space-x / pgpickerview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xiaozhuxiong121/pgpickerview

0.0 2.0 0.0 1.12 MB

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

License: MIT License

Ruby 1.52% Objective-C 98.48%

pgpickerview's Introduction

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 文件。

pgpickerview's People

Contributors

xiaozhuxiong121 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.