Discussion Forums  >  WebViews and HTML for Mobile

Replies: 6    Views: 2343

Pablo
buzztouch Evangelist
Profile
Posts: 51
Reg: Nov 09, 2011
Argentina
510
05/13/12 05:42 PM (13 years ago)

How to scalesPageToFit in Android?

Hi guys, im using Android - BT 1.5, there is a way to use the webView.scalesPageToFitYES; in the Android webView? Tnks!
 
chrspe
Android Fan
Profile
Posts: 95
Reg: Jan 07, 2012
Buffalo, WY
5,400
like
05/13/12 08:26 PM (13 years ago)
You can do this with Eclipse. In the src directory, Bt_screen_customurl java file there is a setting webView.setInitialScale(); For Droid X I set mine to 56% and it works well. Just put 56. Here is a good listing of some other settings http://stackoverflow.com/questions/8220529/webview-scale-then-to-enable-setusewideviewport-without-button
 
Pablo
buzztouch Evangelist
Profile
Posts: 51
Reg: Nov 09, 2011
Argentina
510
like
05/14/12 06:57 AM (13 years ago)
Tnks Chrspe, it works excellent!
 
nickrick32
Apple Fan
Profile
Posts: 111
Reg: Feb 28, 2011
location unknow...
1,110
like
06/07/12 08:59 AM (13 years ago)
Hi chrspe, there is no Bt_screen_customurl java file? there is BT_screen_custmourlHTML.java but there is no webView.setInitialScale(); I can't find this in src folder. Is there some other solution to scale page to fit? thx
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
09/13/12 07:33 AM (13 years ago)
Having problems with html doc not fitting the emulator screen. I tried to scale it with Chrspe suggestion but didn't work.
 
Pablo
buzztouch Evangelist
Profile
Posts: 51
Reg: Nov 09, 2011
Argentina
510
like
10/21/12 10:33 PM (13 years ago)
Search for: src / com.appname / BT_screen_webView.java webView.setInitialScale(); Change it for: webView.setInitialScale(1); It works with Android phones, but not with tablets, they looks like "little"...
 
Pablo
buzztouch Evangelist
Profile
Posts: 51
Reg: Nov 09, 2011
Argentina
510
like
10/21/12 10:34 PM (13 years ago)
Use it for customURL and HTMLdoc indeed
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.