텍스트 목록보기가있는 기본 경고 대화 상자가 있습니다. & 라디오 버튼.안드로이드 기본 경고 대화 상자의 배경색을 변경하는 방법
텍스트 대신 이미지를 바꿔야합니다 (페이스 북 크레딧, 페이팔, 아래 표시된 신용 카드 대신 이미지 바꾸기) & 또한 경고 대화 상자의 배경색을 변경해야합니다.
style.xml 파일도 값 폴더에 넣습니다.
배경색 변경을 위해 아래 코드에서 어떻게 파일을 구현할 수 있습니까?
내 코드 :
final CharSequence[] items = {"Facebook credit", "Paypal", "Credit Card"};
//ContextThemeWrapper ctw = new ContextThemeWrapper(this, R.style.AboutDialog);
AlertDialog.Builder builder = new AlertDialog.Builder(paymentPage.this);
builder.setTitle("Payment Gateway");
builder.setIcon(R.drawable.gate);
builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
// Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();
}
});
builder.setPositiveButton("Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
payPalPayment();
}
});
builder.setNegativeButton("No",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Toast.makeText(paymentPage.this, "Fail", Toast.LENGTH_SHORT).show();
}
});
AlertDialog alert = builder.create();
alert.show();
}
});
내 이미지 : 나는 좀 같은 문제에 직면
을 당신이 [사용자 지정 대화 상자를 만들] 제안 (http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog). – iTurki