How to remove the WebView top/left 8-pixel inner margin?

by Mattaku Betsujin » Mon, 13 Apr 2009 20:23:22 GMT


Sponsored Links
 I think the margin is probably implemented in C code inside WebKit. I looked
at this in the past as well and couldn't find any Java options to configure
the margins.

What do you mean by accuracy? Do you mean finding the exact position of your
HTML objects inside the WebView?





--~--~---------~--~----~------------~-------~--~----~



How to remove the WebView top/left 8-pixel inner margin?

by Mattaku Betsujin » Tue, 14 Apr 2009 05:27:53 GMT


 There is a hack to do what you want -- make your WebView into a width of 336
-- that way you will have extra 8 pixels on each side. Then, put in
somewhere off screen (use absolute layout), and get a drawing cache from it.
That way, you can use the drawing cache bitmap, and draw that onto the real
screen (minus the 8 pixel borders).

You should also override the onDraw() method. This way you know whenever the
webview changes, and reload your drawing cache.

If you want to handle user input, that would require more hacks so that you
can feed the events to the webview.

I have not exactly done this before, but I have been using WebView in
hackish ways and I think this might work.

Good luck!





--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


How to remove the WebView top/left 8-pixel inner margin?

by Mattaku Betsujin » Tue, 14 Apr 2009 05:49:18 GMT


 Oh, come to think of it, (assuming you want a WebView banner at the top of
the screen) if you use AbsoluteLayout, you can put the WebView at (-8,-8).
This can get rid of the top,left, and right edge.

Then, place another View over the bottom edge of the WebView to cover that
part as well. this way, you have the visible areas of the WebView to extend
exactly to where you want it.


On Mon, Apr 13, 2009 at 2:25 PM, Mattaku Betsujin <





--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Rendering artifacts in OpenGL

I am doing some very basic drawing of triangles in OpenGL, but I am
seeing strange rendering errors. When I draw a textured square (two
triangles) part of the square is missing or the texture is stretched
or corrupted. When I draw a square with no texture, part of the square
is missing sometimes.

I do not see a pattern to when it works and when it doesn't. It might
be broken one run, then after a back button and rerun, it works the
next.

The triangle that's missing is not one of the triangles used to draw
the square. Rather it is part of the first triangle and part of the
second triangle. The triangles are the bottom right half and the top
left half of the square, but the part missing is the bottom left half
of the square.

The problem occurs on both the Droid and on the emulator.

--due to Google Groups Error, I can't post any more. I'll try to add
the details in another post--

-- 

2. OpenGL dropping triangles

I am doing some very basic drawing of triangles in OpenGL, but I am
seeing strange rendering errors. When I draw a textured square (two
triangles) part of the square is missing or the texture is stretched
or corrupted. When I draw a square with no texture, part of the square
is missing sometimes.

I do not see a pattern to when it works and when it doesn't. It might
be broken one run, then after a back button and rerun, it works the
next.

The triangle that's missing is not one of the triangles used to draw
the square. Rather it is part of the first triangle and part of the
second triangle. The triangles are the bottom right half and the top
left half of the square, but the part missing is the bottom left half
of the square.

The problem occurs on both the Droid and on the emulator.

-- 

3. Application installment statistics

4. Populating custom layout from xml resource.

5. Android HAL.

6. Question about BlueZ licenses (LGPL and Apache)

7. How to destroy a thread with blocked call