我正在寻找一种方式来调整(所以它不会触及边缘)的EditText的内部AlertDialog.
我的示例代码
AlertDialog.Builder alert = new AlertDialog.Builder(myActivity.this);
alert.setTitle("Test");
EditText textBox = new EditText(myActivity.this);
alert.setView(textBox);
alert.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// do nothing
}
});
alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// do nothing
}
});
alert.show();
Run Code Online (Sandbox Code Playgroud)
我试过这里提供的解决方案没有成功:
我经常遇到以下错误:
res\drawable\my-image-48.png:文件名无效:必须只包含[a-z0-9_.]
我的文件名是"my-image-48.png",它似乎符合错误中列出的约束.
我错过了什么?