3

i have one html file.And i display this html file using webview. i try to display the all text contain page wise.so i lock the scrolling of webview. And display page wise. My problem is when i display some text contain according to webview height some last part of text is cut and display half.

like this


Display text cut image.


so my problem is how to put the text padding in webview like a textview?

  • EDIT

CODE

wv=(WebView) findViewById(R.id.webView1);

        //This is gesture For webpage
        gestureDetector = new GestureDetector(myContext, new MyGestureDetector());//This For swipe gesture.
        wv.setOnTouchListener(this);
        wv.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);//Stop Horizontal scroll.


Load Webview Url Data.

wv.loadDataWithBaseURL("", All_Xml_str,"text/html" , "utf-8", "");

All_Xml_Str. get the whole contain of html.

i am stuck. i try so many thing but can't success.
Please help me.
Thanks.

Zala Janaksinh
  • 2,929
  • 5
  • 32
  • 58

2 Answers2

0

You are going to have to format the data separately in JavaScript. Tag and class all the elements in the script and then throw in some CSS to pretty things up using those classes. To save processing time for multiple views, I would cache the processed blob in a database.

Remember to enable Javascript in your webview settings.

Community
  • 1
  • 1
Steven Mann
  • 558
  • 3
  • 14
0

Did you try set domStorageEnabled in settings webview?

example: webView.settings.domStorageEnabled = true

Chuong Le Van
  • 274
  • 1
  • 8