Department of Famous Door Android (7)

Source: Internet
Author: User

Department of Famous Door Android (7)-Control (View) Zoomcontrols,include,videoview,webview,ratingbar,tab,spinner,chronometer,scrollview

Introduced

Use various controls in Android (View)

Zoomcontrols-Zoom/Shrink Button control

Include-Consolidate controls

Videoview-Video playback controls

WebView-Browser Control

Ratingbar-Rating controls

TAB-Tab control

Spinner-Drop-down Box control

Chronometer-Timer Control

ScrollView-scroll bar control

1, Zoomcontrols's Demo

Zoomcontrols.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <!--
        放大/缩小按钮控件
    -->
    <ZoomControls android:id="@+id/zoomControls"
        android:layout_width="wrap_content" android:layout_height="wrap_content"></ZoomControls>

</LinearLayout>

_zoomcontrols.java

Package Com.webabcd.view;

Import android.app.Activity;
Import Android.os.Bundle;
Import Android.view.View;
Import Android.view.View.OnClickListener;
Import Android.widget.Toast;
Import Android.widget.ZoomControls;

public class _zoomcontrols extends activity {

@Override
protected void OnCreate (Bundle savedinstancestate) {
TODO auto-generated Method Stub
Super.oncreate (savedinstancestate);
This.setcontentview (R.layout.zoomcontrols);

Settitle ("Zoomcontrols");

Zoomcontrols zoomcontrols= (Zoomcontrols) This.findviewbyid (r.id.zoomcontrols);
Setonzoominclicklistener ()-response to an event that clicks the Zoom button
Zoomcontrols.setonzoominclicklistener (New Onclicklistener () {
public void OnClick (View v) {
Toast.maketext (_zoomcontrols.this, "Click the Zoom button", Toast.length_short). Show ();
}
});

Setonzoomoutclicklistener ()-Response to the click of the Shrink button event
Zoomcontrols.setonzoomoutclicklistener (New Onclicklistener () {
public void OnClick (View v) {
Toast.maketext (_zoomcontrols.this, "Click the Zoom button", Toast.length_short). Show ();
}
});

}
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.