how to remove top strip in dialog box

140 views Asked by At

I open the activity in dialog box.how to remove top strip.

my themes code:

<style name="My_search_dailog" parent="Base.V7.Theme.AppCompat.Light.Dialog">
        <item name="android:windowNoTitle">true</item>

        <item name="android:windowFullscreen">true</item>
        <item name="android:windowIsFloating">true</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
        <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
        <item name="android:windowBackground">@android:color/darker_gray</item>
    </style>

out put:enter image description here

please help me

3

There are 3 answers

1
Jignesh Jain On

Update your style

 <style name="My_search_dailog" parent="Base.V7.Theme.AppCompat.Light.Dialog">
 <item name="android:windowNoTitle">true</item>
  <item name="windowActionBar">false</item>
  </style>
0
Suman Dey On

Use LayoutInflater for your custome dialog view.

AlertDialog.Builder builder = new AlertDialog.Builder(context);
final LayoutInflater inflater = activity.getLayoutInflater();
final View view = inflater.inflate(R.layout.caution_dialog, null);
builder.setView(view);
override +ve button and -ve button
AlertDialog alert = builder.create();
alert.show();
0
Sandeep Insan On

I faced the same problem and solved it by adding "requestWindowFeature" attribute in Java file where i am showing this dialog.

    Dialog dialog = new Dialog();
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.show();