implementation 'com.baoyz.actionsheet:library:1.1.7'
然后设置按钮点击监听,,调用下列代码即可
ActionSheet.createBuilder(this, getSupportFragmentManager())
.setCancelButtonTitle("取消")
.setOtherButtonTitles("申通快递","EMS","顺丰速运","圆通快递","中通快递","韵达快递"
,"天天快递","汇通快递","全峰物流","德邦物流","宅急送")
.setCancelableOnTouchOutside(true)
.setListener(this).show();
下面是点击事件
@Override
public void onDismiss(ActionSheet actionSheet, boolean isCancel) {
Toast.makeText(getApplicationContext(), "click item index = " + isCancel ,
Toast.LENGTH_LONG).show();
}
@Override
public void onOtherButtonClick(ActionSheet actionSheet, int index) {
Toast.makeText(getApplicationContext(), "dismissed isCancle = "+ index, Toast.LENGTH_LONG).show();
}