我的fragment把activity遮住了

当我点击第一个text按钮时,跳出来的fragment会把我先前的东西挡住

img

img


package com.example.h.addressbook;

import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        TextView textView= (TextView) findViewById(R.id.text1);
        textView.setOnClickListener(l);

    }
    View.OnClickListener l=new View.OnClickListener() {
        @Override
        public void onClick(View v) {
           FragmentManager fm = getFragmentManager();
            switch (v.getId()){
                case R.id.text1:
                    FragmentTransaction ft= fm.beginTransaction();
                    ft.replace(R.id.fragment,new AddressFragment()).commit();
                    break;
                default:break;
            }
        }
    };
}


``````xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.h.addressbook.MainActivity">

   <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/fragment">
    </FrameLayout>

   <ScrollView
       android:layout_width="match_parent"
       android:layout_height="match_parent">
       <LinearLayout
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:orientation="vertical">
       <TextView
           android:id="@+id/text1"
           android:layout_marginTop="10dp"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:text="刘亦菲"
           android:textSize="25dp"/>
       <TextView
           android:layout_marginTop="10dp"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:text="刘亦菲"
           android:textSize="25dp"/>
       <TextView
           android:layout_marginTop="10dp"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:text="刘亦菲"
           android:textSize="25dp"/>
       <TextView
           android:layout_marginTop="10dp"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:text="刘亦菲"
           android:textSize="25dp"/>
       <TextView
           android:layout_marginTop="10dp"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:text="刘亦菲"
           android:textSize="25dp"/>
           <TextView
               android:layout_marginTop="10dp"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:text="刘亦菲"
               android:textSize="25dp"/>
           <TextView
               android:layout_marginTop="10dp"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:text="刘亦菲"
               android:textSize="25dp"/>
           <TextView
               android:layout_marginTop="10dp"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:text="刘亦菲"
               android:textSize="25dp"/>
           <TextView
               android:layout_marginTop="10dp"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:text="刘亦菲"
               android:textSize="25dp"/>
           <TextView
               android:layout_marginTop="10dp"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:text="刘亦菲"
               android:textSize="25dp"/>
           <TextView
               android:layout_marginTop="10dp"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:text="刘亦菲"
               android:textSize="25dp"/>
           <TextView
               android:layout_marginTop="10dp"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:text="刘亦菲"
               android:textSize="25dp"/>
           <TextView
               android:layout_marginTop="10dp"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:text="刘亦菲"
               android:textSize="25dp"/>
           <TextView
               android:layout_marginTop="10dp"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:text="刘亦菲"
               android:textSize="25dp"/>
       </LinearLayout>

   </ScrollView>


</RelativeLayout>


我的解答思路和尝试过的方法
我想要达到的结果

fragment设置个背景,然后充满布局