0

I need to develop one android application. What I need here is, when I click on ImageView, size of text size automatically increased. How can I do this?

I have used below code:

String title = in.getStringExtra("Title");
lblName = (TextView) findViewById(R.id.title);
lblName.setText(title);
ImageView positive = (ImageView) findViewById(R.id.imageView3);
positive.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
lblName.setTextSize(TypedValue.COMPLEX_UNIT_PX, lblName.getTextSize() + 2);
  }  
});   

Here the textSize is increased well on TextView..how can i increase the textSize on android webview...

please give me solution for these ???

WebView des = (WebView) findViewById(R.id.des);
String description = in.getStringExtra("Description");
des.loadDataWithBaseURL(null,description, "text/html", "UTF-8", null);

How can i increase the textSize for these description ????

I have added below code:

WebSettings webSettings = des.getSettings();
webSettings.setTextSize(WebSettings.TextSize.SMALLEST);

I have to run the app which means am getting the text is smallest fontsize.but i wish to increase the fontsize while clicking imagview...

NOTE:

Please see here. See the 2nd image at bottom -A and +A image is there. Clicking that images means automatically increase and decrease the whole app textview font size. How can I do this in android app?

henrywright
  • 10,070
  • 23
  • 89
  • 150
user2098063
  • 85
  • 1
  • 1
  • 7

2 Answers2

0

use

webView.zoomIn();

user feel like the textsize is increasing.

Mudassar Shaheen
  • 1,397
  • 1
  • 9
  • 15
0
WebSettings web_settings = web_view.getWebSettings();
web_settings.setTextZoom((int)(web_settings.getTextZoom()*1.2));
eski
  • 7,917
  • 1
  • 23
  • 34
  • i have used these code:but am getting following error:Multiple markers at this line - The method setTextZoom(int) is undefined for the type WebSettings - The method getTextZoom() is undefined for the type WebSettings – user2098063 Mar 11 '13 at 07:09
  • It was added in API 14, if you are below use web_settings.setTextSize(), as per DJHacktorReborn's answer – eski Mar 11 '13 at 07:12
  • then how can i increase the textSize on webview before the version like 2.2 ??? – user2098063 Mar 11 '13 at 07:44