安卓自定义控件全解

全栈工程师开发手册 (作者:栾鹏)

安卓教程全解

安卓自定义控件:包含LinearLayout、RelativeLayout、GridView、Button等

本文以LinearLayout为例

首先要有一个自定义xml布局文件

我们这里存储下面的代码为ui_linearlayout.xml文件


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="horizontal"
  android:layout_width="match_parent"
  android:layout_height="wrap_content

你可能感兴趣的:(安卓开发手册)