开发者

Android - DialogPreferenec with one button only

开发者 https://www.devze.com 2023-02-14 17:58 出处:网络
By default,开发者_高级运维 DialogPreference has two buttons - OK and Cancel. I want to leave only the OK button and remove the cancel button - how can i do that?You can easily remove the cancel button

By default,开发者_高级运维 DialogPreference has two buttons - OK and Cancel. I want to leave only the OK button and remove the cancel button - how can i do that?


You can easily remove the cancel button or okey button just set the setNegativeButtonText(null); for cancel and setPositiveButtonText(null); for okey.


Take a look at this example: http://developer.android.com/guide/appendix/faq/commontasks.html#alerts

You should only need the setPositiveButton attibute.

0

精彩评论

暂无评论...
验证码 换一张
取 消