独自のカスタム レイアウトを使用Dialog
および追加して、その中のすべてのビューの外観を制御できます。これを行う方法の例を次に示します。
final Dialog alert = new Dialog(FingerPaintActivity.this, android.R.style.Theme_Light_Panel);
alert.requestWindowFeature(Window.FEATURE_NO_TITLE); // no title
alert.getWindow().getAttributes().windowAnimations = R.style.PauseDialogAnimation; // this is used for custom animation when dialog is showing and hiding
alert.setContentView(getLayoutInflater().inflate(R.layout.stamps, null)); // here is your custom layout
alert.getWindow().setLayout(width-50, (height-100)); // set height / width
次のように、ビュー(ボタンなど)に設定リスナーを使用できます。
Button myOkBtn = (Button) alert.findViewById(R.id.myOkBtn);
myOkBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});