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. Apn axis

Ada yang bisa bantu settingan apn axis

TIA

sent from si robot ijo magic

2. apps: tubedroid

Thanks wol....

Moga2 gapapa.....

Gtalk: riswanc

sent from a milestone
Powered by Robot Idjo, pushed by Indosat3G bandwidth




kali aja ada yg butuh :)

gue post aja di sini gpp kan?

please warn me, kalo emang ga boleh
nuhun

ps: di downloader itu, setting, bisa ada pilihan, mau donlod low, high or HD
:)

warning aja kalo HD beneran HD ga bisa diputer di android, tp diputer di
komputer, asoy tuh :)



--
=========================
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group:

Click  

3. business card scanner

4. (WTA): multi touch di N1

5. 32-bit Color Depth

6. dalvikvm unable to dlopen(/system/lib/libdvsdk.so)

7. Catching an action without setting an intent filter?