回答
使用此片段修复它!
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. JTable未显示colums标题
- 2. UICollectionView标题未显示
- 3. window.open-标题标签中未显示铬
- 4. 图标在标题栏中的标题未显示
- 5. 未命名的标题显示为空
- 6. Reporting Services - 标题列未显示?
- 7. 标题未在MKMapView中显示注释
- 8. 标题未显示在JTable中
- 9. 未显示页面视图标题
- 10. JTable标题未显示在JScrollPane中
- 11. 在Chrome中未显示WebVTT标题
- 12. 显示标题
- 13. 标记未显示
- 14. :目标未显示
- 15. 未在浏览器标题栏中显示的WordPress标题
- 16. 与游标一起使用AlertBuilder
- 17. 显示首页,但在标题显示页面未找到
- 18. 鼠标光标未显示
- 19. 显示标题栏
- 20. 显示Picasa标题
- 21. 标题不显示?
- 22. 标签标题不显示
- 23. wp_title显示页面标题,但不显示网站标题
- 24. 问题 - 未显示以及
- 25. Orchard CMS 1.7 - 网站上未显示标题更改。 Layout.cshtml问题
- 26. 将主题应用于对话框后,未显示标题
- 27. 文件名后面的问题标记未显示回显
- 28. 徽标未显示在getSupportActionBar()
- 29. MapView未显示 - 目标C
- 30. 标签内容未显示
凡从叫这个代码? 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