Department of Famous Door Android (5)

Source: Internet
Author: User

Department of Famous Door Android (5)-Control (View) Textview,button,imagebutton,imageview,checkbox,radiobutton,analogclock,digitalclock

Introduced

Use various controls in Android (View)

TextView-Text Display control

button-Buttons Control

ImageButton-Picture Button control

ImageView-Picture Display control

CheckBox-check box control

RadioButton-Radio Box control

AnalogClock-Clocks (with a dial) control

DigitalClock-Electronic Table controls

1, TextView's Demo

Textview.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">

    <!--
        TextView - 文本显示控件
    -->
    <TextView android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:id="@+id/textView" />

</LinearLayout>

_textview.java

Package Com.webabcd.view;

Import android.app.Activity;
Import Android.os.Bundle;
Import Android.widget.TextView;

public class _textview extends activity {

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

Set the title of an activity
Settitle ("TextView");

TextView txt = (TextView) This.findviewbyid (R.id.textview);
Sets the text content of the text display control, using "\ n" If you want to change lines
Txt.settext ("I am textview\n display text");
}
}

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.