开发者

Why doesn't setting icon to null on an AlertDialog subclass hide the icon?

I have a subclass of ActivityDialog that is instantiated using Activity.showDia开发者_Python百科log() and Activity.onCreateDialog().

In my subclasses overridden version of ActivityDialog.onCreate(), I can change the icon by calling setIcon(R.drawable.some_drawable_resource).

However, oddly, I can't make the default icon not show by calling setIcon(null). Am I missing something?

Thanks.


If your question is, how do I hide the icon, you can call a different method to do this:

http://developer.android.com/reference/android/app/AlertDialog.html#setIcon(int)

Call the above method and pass in the int literal 0. (That is, according to the documentation. I have not tried this myself.)

As for why setting the icon to null doesn't hide the icon, you will have to ask the developers themselves.


You can try to implement your own layout for the dialog where you don't specify a icon.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜