神無木
2016-05-16 02:05
采纳率: 100%
浏览 1.8k
已采纳

【Android】请问如何去除自定义AlertDialog的背景?

图片说明

Activity

 public void onSchulteButtonClick(View v) {
        LayoutInflater inflater = LayoutInflater.from(this);
        View SchulteSelectView = inflater.inflate(
                R.layout.activity_schulte_select_dialog, null);
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setView(SchulteSelectView);
        builder.show();
  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • 神無木 2016-05-16 02:39
    已采纳

    解决了

     public void onSchulteButtonClick(View v) {
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            AlertDialog dialog = builder.create();
            View SchulteSelectView = getLayoutInflater().inflate(R.layout.activity_schulte_select_dialog, null);
            TextView tvNumLeft = (TextView) SchulteSelectView.findViewById(R.id.tv_schulte_select_num_left);
            TextView tvNumRight = (TextView) SchulteSelectView.findViewById(R.id.tv_schulte_select_num_right);
            ImageButton ibIncrease = (ImageButton) SchulteSelectView.findViewById(R.id.ib_schulte_increase);
            ImageButton ibDecrease = (ImageButton) SchulteSelectView.findViewById(R.id.ib_schulte_decrease);
            dialog.show();
            dialog.setContentView(SchulteSelectView);
        }
    
    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题