Android 项目基础之XML
16lz
2021-01-23
res.layout.main.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" 子元素垂直排列 or android:orientation="horizontal" 子元素水平排列 android:layout_width="fill_parent" 横向充满整个屏幕 or android:layout_width="wrap_content" 根据视图的大小改变宽度 android:layout_height="fill_parent" 坚向充满整个屏幕 or android:layout_height="wrap_content" 根据视图的大小改变高度 ><TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" TextView 要显示的文本,字符串或者是字符串的引用, 这里是一个引用,引用的是 strings.xml 定义好的名字为 hello 的字符串 /></LinearLayout>
res.values.strings.xml<?xml version="1.0" encoding="utf-8"?><resources> <string name="hello">Hello World, HelloWorld!</string> <string name="app_name">HelloWorld</string></resources>
AndroidManifest.xml<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.xserver.hello" 本应用的包 android:versionCode="1" 本应用的版本号 android:versionName="1.0"> 本应用的版本名字 一个应用只有一个application,引用的资源和应用名称 <application android:icon="@drawable/icon" android:label="@string/app_name"> activity的类名 和 标题 <activity android:name=".HelloWorld" android:label="@string/app_name"> <intent-filter>过滤什么的。。 <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> //SDK的最低版本要求 <uses-sdk android:minSdkVersion="9" /></manifest>
更多相关文章
- Android——GridView(网格视图)相关知识总结贴
- Android Studio 工程视图&项目构成
- Android 网格视图(GirdView)简易适配器的使用
- Android坐标系、视图坐标系与触控事件(MotionEvent)
- Android 自定义RadioButton样式 RadioGroup横向排列并分行
- Android界面设计之:使用水平视图切换
- 2.4.11 网格视图和图像切换器
- 2.4.12 画廊视图
- 2.4.9 列表视图