How to remove email icon from Android Studio emulation

后端 未结 5 1288
故里飘歌
故里飘歌 2020-12-29 02:53

How do I get rid of the email icon on the bottom of the phone? It is on all of them and it shouldn\'t be there.

相关标签:
5条回答
  • 2020-12-29 03:00
    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/fab_margin"
        android:src="@android:drawable/ic_dialog_email" />
    

    Delete this code from app_bar_main.xml

    0 讨论(0)
  • 2020-12-29 03:04

    This is what your looking to remove

     <android.support.design.widget.FloatingActionButton android:id="@+id/fab"
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"   android:layout_margin="@dimen/fab_margin"
        android:src="@android:drawable/ic_dialog_email" />
    

    its not in the activity_main.xml its inside the app_bar_main.xml

    0 讨论(0)
  • Look for src attribute in your layout file of the Activity and change it.

    <android.support.design.widget.FloatingActionButton
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_email"
                app:elevation="4dp"
                ... />
    
    0 讨论(0)
  • 2020-12-29 03:07

    Go to activity_main.xml and delete this portion:

    <android.support.design.widget.FloatingActionButton android:id="@+id/fab"
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:layout_gravity="bottom|end" android:layout_margin="@dimen/fab_margin"
            android:src="@android:drawable/ic_dialog_email" />
    

    And then go to MainActivity.java and delete this portion

    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
            fab.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                            .setAction("Action", null).show();
                }
            });
    

    That's it. You should now see that the icon disappeared.

    0 讨论(0)
  • 2020-12-29 03:20

    I guess you are looking for it in content_main.xml and that is why you don't see it. Check activity_main.xml and delete it from there.

    0 讨论(0)
提交回复
热议问题