Note that there are some explanatory texts on larger screens.

plurals
  1. POBring an imageView to top in framelayout
    primarykey
    data
    text
    <p>I have a framelayout in which there is surfaceView and an ImageView, the ImageView being invisible .Based on some event the ImageView has to become visible. But it isnt coming to the foreground. I know the image has become visible as i can see in the logs but its not showing because its not on the top, the SurfaceView is. So how can I bring the ImageView to the top?? Here is my code.</p> <p>public void onClick(View v) {</p> <pre><code> if(v.getId() == R.id.Button1) { Toast.makeText(getApplicationContext(), "Button1", Toast.LENGTH_SHORT).show(); image = (ImageView) findViewById(R.id.lockIcon1); if(!icon1show) { icon1show = true; image.setVisibility(View.VISIBLE); }else { icon1show = false; image.setVisibility(View.INVISIBLE); } }else if( v.getId() == R.id.Button2) { Toast.makeText(getApplicationContext(), "Button2", Toast.LENGTH_SHORT).show(); image = (ImageView) findViewById(R.id.lockIcon2); if(!icon2show) { icon2show = true; image.setVisibility(View.VISIBLE); }else { icon2show = false; image.setVisibility(View.INVISIBLE); } } } </code></pre> <p>XML code:</p> <p></p> <pre><code> &lt;ImageView android:id="@+id/lockIcon2" android:src="@drawable/lockicon" android:visibility = "invisible" android:layout_width="wrap_content" android:layout_height="wrap_content"/&gt; &lt;SurfaceView android:id="@+id/far_end" android:layout_height="217.33dip" android:layout_width="291dip"/&gt; &lt;/FrameLayout&gt; </code></pre> <p>Now the image from "lockIcon2" is not showing as there is a SurfaceView along with that imageView in a frameLayout. So please help !!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload