开发者

Android - DialogPreferenec with one button only

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜