且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Android 中自定义权限对话框?

更新时间:2022-01-24 22:44:07

简短的回答是,你不能.

正如 android 文档所说:

As android documentation puts:

当您的应用调用 requestPermissions() 时,系统会向用户显示一个标准对话框.您的应用无法配置或更改该对话框.如果您需要向用户提供任何信息或解释,则应在调用 requestPermissions() 之前执行此操作,如解释应用为何需要权限"中所述.

When your app calls requestPermissions(), the system shows a standard dialog box to the user. Your app cannot configure or alter that dialog box. If you need to provide any information or explanation to the user, you should do that before you call requestPermissions(), as described in "Explain why the app needs permissions".

因此,目前无法为权限对话框定义自定义布局.

So, there is no way to define a custom layout for the permission dialog for now.

您可以在此处找到更多详细信息:http://developer.android.com/training/permissions/requesting.html

You can find more detailed information here: http://developer.android.com/training/permissions/requesting.html