package org.andylee1988;

import android.app.Activity;

import android.os.Bundle;

public class HelloAndylee1988 extends Activity {

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState) {

super .onCreate(savedInstanceState);

setContentView(R.layout. main );

}

}

Google Android之使用XML布局_第1张图片

编辑main.xml,输入以下代码:

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

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

android:layout_width = "fill_parent"

android:layout_height = "fill_parent"

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

Google Android之使用XML布局_第2张图片

编辑strings.xml,输入:

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

< resources >

< string name = "hello" > Hello, andylee1988! I am a string resource! </ string >

< string name = "app_name" > Andylee1988 </ string >

</ resources >

Google Android之使用XML布局_第3张图片

运行后将看到:

Google Android之使用XML布局_第4张图片

更多相关文章

  1. android 拖拽图片&拖动浮动按钮到处跑
  2. Android实现图片缩放示例
  3. android 获取网络上服务器图片
  4. Android Studio App LinearLayout多层布局嵌套
  5. Android图片裁剪Demo
  6. Android 中实现FlowLayout 布局
  7. android URL获取图片显示到ImageView 控件上
  8. android edittext编辑框光标改变事件
  9. Android中GridView来显示图片

随机推荐

  1. 使用java获取未来7天天气信息,可用于andro
  2. Android Material Design 使用TabLayout
  3. Android:overridePendingTransition()函
  4. Android 嵌套滑动机制(NestedScrolling)
  5. Android 图片选择器 PictureSelector
  6. 系出名门Android(7) - 控件(View)之ZoomC
  7. Android刷Recovery
  8. Android倒计时功能的实现(CountDownTimer
  9. Android 3.0 r1中文API文档(103) ―― In
  10. Android学习笔记之布局2