Android common UI Components

Source: Internet
Author: User

Android common UI Components
TextView is the most commonly used UI component in Android. When you need to display some information, TextView cannot be entered. It can only be set initially or modified in a program.
Instance: TextViewDemoRunning effect:
Code List:Layout file: main. 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 android: layout_width = "fill_parent" android: layout_height = "wrap_content" android: text = "TextView is displayed here. "/> </LinearLayout>
Java source code file: MainActivity. java
package com.rainsong.textviewdemo;import android.app.Activity;import android.os.Bundle;public class MainActivity extends Activity{    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }}


API knowledge point ActivityPublic classActivityextends ContextThemeWrapperimplements ComponentCallbacks2 KeyEvent. Callback LayoutInflater. Factory2 View. OnCreateContextMenuListener Window. Callback
Known Direct SubclassesAccountAuthenticatorActivity, ActivityGroup, AliasActivity, ExpandableListActivity, FragmentActivity, ListActivity, NativeActivity
Known Indirect SubclassesLauncherActivity, PreferenceActivity, TabActivity
Void setContentView (int layoutResID) Set the activity content from a layout resource.
TextViewPublic classTextViewextends Viewimplements ViewTreeObserver. OnPreDrawListener
Known Direct SubclassesButton, CheckedTextView, Chronometer, DigitalClock, EditText, TextClock
Known Indirect SubclassesAutoCompleteTextView, CheckBox, CompoundButton, ExtractEditText, MultiAutoCompleteTextView, RadioButton, Switch, ToggleButton
Class OverviewDisplays text to the user and optionally allows them to edit it. A TextView is a complete text editor, however the basic class is configured to not allow editing; see EditText for a subclass that configures the text view for editing.
Public ConstructorsTextView (Context context) TextView (Context context, AttributeSet attrs) TextView (Context context, AttributeSet attrs, int defStyle)

Has anyone introduced the third-party open-source android UI components?

Continue learning with patience. You have little knowledge about android. The problem you described does not exist. Be patient.
One step at a time.
Track: familiar with the controls provided by the android system-familiar with system controls, changing various control styles-in-depth study of source code, custom controls-.

Has anyone introduced the third-party open-source android UI components?

Although the performance is different, the same can take effect. If you want to build a Fixed UI by yourself, you must use a low-level UI.

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.