이미지 버튼을 클릭하면 팝업 알림 팝업이 나타납니다. 버튼의 기본 모양을 사용하는 대신 "ok"및 "cancel"단추를 사용자 정의하려면 어떻게해야합니까? "Ok"및 "cancel"로 사용자 정의 ImageButton을 사용하고 싶습니다.팝업 알림을 맞춤 설정하는 방법은 무엇입니까?
다음은 팝업 알림을위한 코드입니다. 나는 "를 넣어 원하는 거기에"확인 "과 붉은 색에서"취소 "가되는 그래서 그 대신
: 여기
public class Notifications extends AppCompatActivity {
ImageButton Notifications;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_notifications);
Notifications = (ImageButton) findViewById(R.id.AllowNotifications);
Notifications.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
AlertDialog.Builder builder = new AlertDialog.Builder(Notifications.this);
builder.setCancelable(false); //False= ONLY way to exist notification is by clicking NO
//True= Exit notification by clicking anywhere on screen outside of notification box.
builder.setTitle("Here is the alert dialog");
builder.setMessage("Here is my message thing");
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int WhichButton) {
dialog.cancel();
}
});
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
builder.show();
}
});
}
}
은 기본적으로 위의 코드와 함께 알림 팝업 것 확인 "및"취소 "를 내 사용자 지정 이미지 단추로 사용하면 빨간색을 다른 것으로 변경하려고합니다. 팝업 알림에서 어떻게해야합니까?