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.