如何更改android中对话框窗口的透明背景边距?

时间:2016-11-24 11:59:07

标签: android android-layout dialog margin transparent

在android中我想在适配器中更改对话框弹出窗口的透明背景边距。我的代码如下

final Dialog dialog = new Dialog(mContext);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.getWindow().setLayout(600,600);

    dialog.setContentView(R.layout.horo_popup_window);

    TextView text1 = (TextView) dialog.findViewById(R.id.textView);
    text1.setText("THIS WEEK'S TAURUS HOROSCOPE");

    TextView text = (TextView) dialog.findViewById(R.id.textView1);
    text.setText("Step out of your usual role, Taurus. Doing this every now and then can add knowledge and expand your life. The day's planetary aspects favor such growth. Your willingness to walk a different path can give you far more than you imagine. Try something you've never considered before. Go to a new place. Change your desk around. See what you can discover about yourself and the world.");

    ImageView image = (ImageView) dialog.findViewById(R.id.image);
    image.setImageResource(R.drawable.taurus1);

    ImageButton dialogButton = (ImageButton) dialog.findViewById(R.id.imageButton);
        dialogButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
            }
        });

    dialog.show();

`
我想要像这张照片中所示的东西

Dialog Picture

0 个答案:

没有答案