Android Dialog: Removing title bar

后端 未结 13 2288
醉酒成梦
醉酒成梦 2020-11-29 18:24

I have a weird behavior I can\'t pinpoint the source of.

I have my app with the classic

requestWindowFeature(Window.FEATURE_NO_TITLE);
13条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 19:07

    You can try this simple android dialog popup library. It is very simple to use on your activity.

    When submit button is clicked try following code after including above lib in your code

    Pop.on(this)
       .with()
       .title(R.string.title) //ignore if not needed
       .icon(R.drawable.icon) //ignore if not needed
       .cancelable(false) //ignore if not needed
       .layout(R.layout.custom_pop)
       .when(new Pop.Yah() {
           @Override
           public void clicked(DialogInterface dialog, View view) {
               Toast.makeText(getBaseContext(), "Yah button clicked", Toast.LENGTH_LONG).show();
           }
       }).show();
    

    Add one line in your gradle and you good to go

    dependencies {
        compile 'com.vistrav:pop:2.0'
    }
    

提交回复
热议问题