安卓如何实现层布局

2025-10-24 11:05:12

1、打开eclipse软件:

    如图,所示打开我们的eclipse软件,并且建立一个Android工程;

安卓如何实现层布局

2、配置好虚拟机,如图,所示打开虚拟机;

安卓如何实现层布局

3、在工程中打开文件0“res/layout/activity_main.xml”,并且打开该文件,如图中所示;

安卓如何实现层布局

4、写入一下代码,结果如图中所示:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"

      xmlns:tools="http://schemas.android.com/tools"

      android:layout_width="fill_parent"    

      android:layout_height="fill_parent"> 

      <TextView 

          android:text="大"

          android:layout_width="wrap_content"

          android:layout_height="wrap_content"

          android:textSize="50pt"></TextView>

      <TextView 

          android:text="中"

          android:layout_width="wrap_content"

          android:layout_height="wrap_content"

          android:textSize="20pt"></TextView>

    <TextView 

          android:text="小"

          android:layout_width="wrap_content"

          android:layout_height="wrap_content"

          android:textSize="10pt"></TextView>

        

</FrameLayout>    

安卓如何实现层布局

5、运行我们的程序,如图中所示,相信大家都应该写过第一个程序了,也都知道如何运行一个工程的配置了;

如果不知,请看下面经验;

安卓如何实现层布局

6、接着我们就可以查看我们的运行结果了;

安卓如何实现层布局

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢