We usually on the phone, especially after the use of access to the browser, often see some of the game will zoom out, in fact, very simple.
------------------------the use of zoomcontrols.
public class Zoomcontrolleractivity extends Activity{private TextView mytextview;private zoomcontrols Myzoomcontroller ;p rivate int size = 25;; @Overrideprotected void OnCreate (Bundle savedinstancestate) {//TODO auto-generated method Stubsuper.oncreate ( Savedinstancestate); Setcontentview (r.layout.zooncontroller_layout); Mytextview = (TextView) Findviewbyid ( R.id.mytextview); Myzoomcontroller = (zoomcontrols) Findviewbyid (R.id.myzoomcontroller);; Myzoomcontroller.setonzoominclicklistener (New Onzoomintroller ()); Myzoomcontroller.setonzoomoutclicklistener (new Onzoomouttroller ());} /** * Shrink Listener * @author Androidstartjack * */private class Onzoomintroller implements onclicklistener{@Overridepublic void O Nclick (View v) {toast.maketext (Getapplicationcontext (), "Aaaaaaa", 0). Show (); size = Size +2;mytextview.settextsize ( size);}} /** * Magnification listener * @author Androidstartjack * */private class Onzoomouttroller implements onclicklistener{@Overridepublic void OnClick (View v) {size = Size-2; Toast.maketext (getapplicAtioncontext (), "bbbbbbbbbbbbbbbb", 0). Show (); mytextview.settextsize (size);}}}
------XML Code:
<?xml version= "1.0" encoding= "Utf-8"? ><linearlayout xmlns:android= "http://schemas.android.com/apk/res/ Android " android:layout_width=" match_parent " android:layout_height=" match_parent " android:o rientation= "vertical" > <textview android:id= "@+id/mytextview" android:layout_width= "Match_ Parent " android:layout_height=" 50DP " android:background=" #fe00fe " android:gravity=" center " Android:text= "This is the study of Zoomtroller"/> <zoomcontrols android:id= "@+id/myzoomcontroller" android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:gravity= " Center_horizontal "/></linearlayout>
See if it's simple. Of course you can make a variety of sizes according to your needs.
Use of Android Zoomcontrols