diff --git a/README.md b/README.md index 3cc8088e..c207551a 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,93 @@ dependencies { ## 用法示例 -常见用法参阅 [demo](/app),建议拉取代码运行,对比查看实际效果。 +常见用法请参阅 [demo](/app),高级用法请细读[源码](/WheelPicker)。强烈建议拉取代码运行,尝试修改 demo 对比查看实际效果以便加深理解。 + +### 在 Java 中 + +```groovy + OptionPicker picker = new OptionPicker(this); + picker.setBackgroundColor(true, 0xFFFFFFFF); + picker.setData("测试", "很长很长很长很长很长很长很长很长很长很长很长很长很长很长"); + picker.setOnOptionPickedListener(this); + picker.getTitleView().setText("这是标题"); + picker.getWheelView().setCyclicEnabled(true); + picker.getWheelView().setCurvedEnabled(true); + picker.getWheelView().setCurvedMaxAngle(60); + picker.show(); +``` + +```groovy + AddressPicker picker = new AddressPicker(this); + picker.setAddressMode(AddressMode.PROVINCE_CITY_COUNTY); + picker.setDefaultValue("贵州省", "贵阳市", "观山湖区"); + picker.setOnAddressPickedListener(this); + picker.show(); +``` + +### 在 XML 中 + +```xml + + + + + + + + + + + + + + + +``` ## 效果预览