user2182071
user2182071

Reputation: 35

textsize is increase on android webview

I have to develop one android webview application.

Here am getting the text from that webview.

How can i increase the textsize on these webview while clicking imageview???

This is my webview code:

String fullcontent = in.getStringExtra("FullContent");

 content.loadDataWithBaseURL(null,fullcontent, "text/html", "UTF-8",null);

Here i have one imageview.i have to click these imageview means the textsize is increase automatically..how can i develop these ????

ImageView positive = (ImageView) findViewById(R.id.imageView3);
  positive.setOnClickListener(new OnClickListener() {
 public void onClick(View v) {
WebSettings webSettings = fullcontent.getSettings();
webSettings.setTextSize(WebSettings.TextSize.SMALLEST);
       }  
});   

Here the webview text is smallest.but i wish to display the text is automatically increase while clicking imgaeview..

Please give me some idea to develop these ...

Upvotes: 0

Views: 1496

Answers (1)

duggu
duggu

Reputation: 38409

try below code hope useful to you:-

int text_size=16;

ImageView positive = (ImageView) findViewById(R.id.imageView3);
positive.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
text_size++;
webview.getSettings().setDefaultFontSize(text_size);
   }  
});   

this is below code to set text size in webview:-

webview.getSettings().setDefaultFontSize(22);

Upvotes: 1

Related Questions