回答
使用此片段修复它!
new AlertDialog.Builder(getApplicationContext())
.setIcon(android.R.drawable.ic_dialog_info)
.setTitle(getResources().getString(R.string.pull))
.setCancelable(false)
.setMessage("Quistion???")
.setPositiveButton("Yes",
new DialogInterface.OnClickListener() {
public void onClick(
DialogInterface dialog,
int which) {
}
})
.setNegativeButton("No",
new DialogInterface.OnClickListener() {
public void onClick(
DialogInterface dialog,
int which) {
}
}).show();
这并没有强调他做错了什么,只是向他展示了他已经做了什么。 – Doomsknight 2013-03-20 09:26:12
http://developer.android.com/reference/android/app/AlertDialog.Builder.html#setTitle(int)。这不是一个答案,因为setTitle可以采用resourceID。 – Raghunandan 2013-03-20 09:30:14
getResources()。getString(R.string.pull) – XEENA 2013-03-20 09:32:37
你必须使用这样的:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(getResources().getString(R.string.pull));
builder.setIcon(R.drawable.ic_action_search);
builder.setPositiveButton("OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// actions
}
});
AlertDialog dialog = builder.create();
dialog.show();
尤尔标题LL现在显示...
不,对不起,这没有工作 – user1256477 2013-03-20 09:49:35
- 1. Reporting Services - 标题列未显示?
- 2. 未命名的标题显示为空
- 3. :目标未显示
- 4. 未在浏览器标题栏中显示的WordPress标题
- 5. 与游标一起使用AlertBuilder
- 6. 显示标题栏
- 7. 显示Picasa标题
- 8. WordPress未显示HTML标签
- 9. MapView未显示 - 目标C
- 10. 标签内容未显示
- 11. geocomplete - 标记未显示
- 12. iframe标签未显示C#
- 13. Flex DateTimeAxis未显示标签
- 14. Android FloatingActionMenu未显示标签
- 15. Matplotlib Qt光标未显示
- 16. wp_title显示页面标题,但不显示网站标题
- 17. Android MapView标记文本标题未显示
- 18. 将主题应用于对话框后,未显示标题
- 19. UINavigationController显示标题,但不显示
- 20. Tablesorter Bootstrap主题未在标头中显示未排序的图标
- 21. Kivy:鼠标光标未显示
- 22. 标题标签未示出的UIButton
- 23. 无法读取未定义的属性“标题”,但标题显示
- 24. 旋转木马标题未显示在全宽标题旋转木马上
- 25. 显示标题并联footer.php
- 26. ListView标题不显示
- 27. 更改UIBarButton标题显示
- 28. UITabBar标题不显示
- 29. UIButton标题不显示
- 30. Phonegap Android显示标题栏
凡从叫这个代码? R.string.pull的价值是什么?并且该对话框的屏幕截图也将很有用。 – Egor 2013-03-20 09:15:16
嘿setTitle直接'alert.setTitle(“Yourtext”);' – androidgeek 2013-03-20 09:16:40
我试过了,但它不起作用 – user1256477 2013-03-20 09:18:32