Android模仿IOS中的UIActionSheet

Android中模仿IOS中的UIActionSheet,自带IOS6和IOS7两种风格,可以自定义风格,背景图片、按钮图片、文字颜色、间距等。

Github地址:https://github.com/baoyongzhang/ActionSheetForAndroid

/ 创建并显示
ActionSheet.createBuilder( this , getSupportFragmentManager())
                 .setCancelButtonTitle( "Cancel" )
                 .setOtherButtonTitles( "Item1" , "Item2" , "Item3" , "Item4" )
                 .setCancelableOnTouchOutside( true ).setListener( this ).show();
 
// 事件监听
@Override
     public void onOtherButtonClick(ActionSheet actionSheet, int index) {
         Toast.makeText(getApplicationContext(), "click item index = " + index,
                 0 ).show();
     }
 
     @Override
     public void onCancel(ActionSheet actionSheet) {
         Toast.makeText(getApplicationContext(), "cancel" , 0 ).show();
     }
 
     @Override
     public void onDismiss(ActionSheet actionSheet) {
         Toast.makeText(getApplicationContext(), "dismissed" , 0 ).show();
     }
Android模仿IOS中的UIActionSheet_第1张图片

[3].[图片] screenshot-2.png 跳至 [1] [2] [3]

Android模仿IOS中的UIActionSheet_第2张图片

你可能感兴趣的:(Android模仿IOS中的UIActionSheet)