Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to avoid mixup / clipping of tab layouts (incl. SurfaceView) in TabHost?
    text
    copied!<p>In my project I am using a tab host. In one of the tabs there is a Fragment Activity with a Fragment that includes an ImageView with some transparent regions as a background.</p> <p><img src="https://i.imgur.com/zahaT.png" alt="bg.PNG"> </p> <p>Now, in another tab I am incl. the (modified) <a href="http://code.google.com/p/zxing/source/browse/trunk/android/src/com/google/zxing/client/android/CaptureActivity.java" rel="nofollow noreferrer">CaptureActivity</a> of the ZXing QR-Scanner library. I already went through all the hustle of making it work in portrait mode. My issue is, that when I open that one fragment mentioned above (and only in that specific case and order) before the CaptureActivity, the CaptureActivity's layout gets screwed up. The background image of the fragment is shown (although not incl. in this layout) and the camera preview is only shown in the transparent areas, see below. Now, I don't know if that has to do with the surface view included here.</p> <p>Somehow it seems to not only be a drawing / clipping issue, because the textview you can see is drawn on top of the surfaceview and is actually orientated <code>android:layout_gravity="bottom|center_horizontal"</code> (and works that way in every other case), but when this issue occurs the textview seems to be getting aligned within the other fragment layout that incl. the partially transparent background imageview.</p> <p><img src="https://i.imgur.com/xk56R.png" alt="clipping_error.png"> </p> <p>Any hints are really appreciated. I can post some code if I have a lead what might be the problem here. Thanks!</p>
 

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