在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:baoyongzhang/android-ActionSheet开源软件地址:https://github.com/baoyongzhang/android-ActionSheet开源编程语言:Java 100.0%开源软件介绍:ActionSheetThis is like iOS UIActionSheet component, has iOS6 and iOS7 style, support custom style, background, button image, text color and spacing etc. UsageAdd dependencydependencies {
compile 'com.baoyz.actionsheet:library:1.1.7'
} Create ActionSheet and showActionSheet.createBuilder(this, getSupportFragmentManager())
.setCancelButtonTitle("Cancel")
.setOtherButtonTitles("Item1", "Item2", "Item3", "Item4")
.setCancelableOnTouchOutside(true)
.setListener(this).show(); Methods
Listen eventimplementing
@Override
public void onOtherButtonClick(ActionSheet actionSheet, int index) {
Toast.makeText(getApplicationContext(), "click item index = " + index,
0).show();
}
@Override
public void onDismiss(ActionSheet actionSheet, boolean isCancle) {
Toast.makeText(getApplicationContext(), "dismissed isCancle = " + isCancle, 0).show();
} StyleDefault style is bad,ActionSheet has iOS6 and iOS7 style,you can configure the theme. <!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<item name="actionSheetStyle">@style/ActionSheetStyleiOS6</item>
or
<item name="actionSheetStyle">@style/ActionSheetStyleiOS7</item>
</style> You can custom style, can refer to ActionSheetStyleiOS6/ActionSheetStyleiOS7 writing. <!-- iOS7 Style -->
<style name="ActionSheetStyleiOS7">
<item name="actionSheetBackground">@android:color/transparent</item>
<item name="cancelButtonBackground">@drawable/slt_as_ios7_cancel_bt</item>
<item name="otherButtonTopBackground">@drawable/slt_as_ios7_other_bt_top</item>
<item name="otherButtonMiddleBackground">@drawable/slt_as_ios7_other_bt_middle</item>
<item name="otherButtonBottomBackground">@drawable/slt_as_ios7_other_bt_bottom</item>
<item name="otherButtonSingleBackground">@drawable/slt_as_ios7_other_bt_single</item>
<item name="cancelButtonTextColor">#1E82FF</item>
<item name="otherButtonTextColor">#1E82FF</item>
<item name="actionSheetPadding">10dp</item>
<item name="otherButtonSpacing">0dp</item>
<item name="cancelButtonMarginTop">10dp</item>
<item name="actionSheetTextSize">12sp</item>
</style> Style attributes
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论