Siva K
Siva K

Reputation: 4968

How can I to make surfaceview invisible in Android?

in my app i am using a media player with a seek bar. The seek bar of works along with a surface view. Now my problem is the surface view appears at a corner of my layout which appears to be a black screen. How can i make the surface view to be an invisible. Following is the image of my layout,

enter image description here

Upvotes: 3

Views: 9279

Answers (2)

Nallath
Nallath

Reputation: 2116

You can do that by setting the visibility in the code:

surfaceView.setVisibility(View.GONE) or surfaceView.setVisibility(View.INVISIBLE).

And you can do the same by setting it in the XML:

<SurfaceView 
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:visibility="gone"/>

GONE is used if you want it to be completely gone and ignored by the rest of the layout. INVISIBLE is used if you only want to change the visibility.

Upvotes: 6

Kakey
Kakey

Reputation: 4024

you can use surfaceView.setVisibility*(View.INVISIBLE);

Upvotes: -1

Related Questions