I want to add an image with transparent area on top my surface view in fragment, there is my code to add this image, but my tab control in fragment is gone when i add this view, because this is on top of all fragment.
this is my oncreateview in fragment :
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View instagramcase = inflater.inflate(R.layout.top_layer_instagram, container, false);
LayoutParams layoutParamsControl
= new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.MATCH_PARENT);
getActivity().addContentView(instagramcase, layoutParamsControl);
View rootView = inflater.inflate(R.layout.instaar_choose_instagram, container, false);
getActivity().getWindow().setFormat(PixelFormat.UNKNOWN);
surfaceView = (SurfaceView) rootView.findViewById(R.id.previewinstagram);
surfaceHolder = surfaceView.getHolder();
surfaceHolder.addCallback(this);
return rootView;
}
this is my top layer of imageview in xml :
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://ift.tt/nIICcg"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/instagram"
android:scaleType="centerCrop"/>
this is my surfaceview fragment :
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://ift.tt/nIICcg"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<SurfaceView
android:id="@+id/previewinstagram"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
there is 3 fragment in tabhost, but tabcontrol is gone when i add this code, i am confused to add view with transparent imageview layout in top of surfaceview.
Aucun commentaire:
Enregistrer un commentaire