Hello world代码解释

发布时间:2020-08-02 19:08:42 作者:一只小弱鸡
来源:网络 阅读:442

<xml>

<?xml version="1.0" encoding="utf-8"?>

<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
br/>xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
br/>tools:showIn="@layout/activity_main">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
/>
</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>
其中,wrap_content为强制扩充来显示textview中的内容
<MainActivity>
package com.mycompany.helloworld;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends AppCompatActivity {//写方法时继承自Activity@Override//伪代码,表示方法重写
br/>@Override//伪代码,表示方法重写
super.onCreate(savedInstanceState);
//调用Activity的onCreate方法,和Activity必须搭配使用
setContentView(R.layout.activity_main);//setContentView将Activity与xml可视化文件关联的代码
}
}

推荐阅读:
  1. Hello World, Perl
  2. Hello World大全

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

android 代码解释 he

上一篇:svn可以update但是无法commit解决

下一篇:zabbix - 对接钉钉应用接口

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》