android programming- the big nerd ranch guide

Widgets are the building blocks you use to compose a user interface. A widget can show text or graphics, interact with the user, or arrange other widgets on the screen. Buttons, text input controls, and check boxes are all types of widgets.

    The Android SDK includes many widgets that you can configure to get the appearance and behavior you want. Every widget is an instance of the View class or one of its subclasses (such as TextView or Button).

 

LinearLayout inherits from a subclass of View named ViewGroup. Other ViewGroup subclasses are FrameLayout, TableLayout, and RelativeLayout.

<Button

      android:id="@+id/false_button"

      android:layout_width="wrap_content"

      android:layout_height="wrap_content"

      android:text="@string/false_button" />

Notice that there is a + sign in the values for android:id but not in the values for android:text. This is because you are creating the IDs and only referencing the strings.

猜你喜欢

转载自hooroger.iteye.com/blog/2068350
今日推荐