Android 学习笔记1
2016-02-17 21:33
393 查看
Eclipse+ADT+sdk 平台搭建好后,新建工程,使用安卓虚拟设备管理新建了模拟器,运行工程,结果模拟器死机了,经过查找,发现工程使用的设备和模拟器里的设备不一致,改过来后,出现了HELLOW WORLD!这才算是真正搭建好了。
在学习线性布局时 ,又遇到了警告
提示是要@string.
警告消失。
线性布局比较简单,如果放置几行或几列的话,要使用线性布局嵌套了,然而复制了代码后,提示错误“Unexpected
namespace prefix "xmlns"
found for
tag LinearLayout”,
网上查到删除嵌套里的
就OK了。
在学习线性布局时 ,又遇到了警告
android:text="Button1"
提示是要@string.
<string name="Button1">按钮1</string>
在string.xml添加上面资源,在布局中修改为
android:text="@string/Button1"
警告消失。
线性布局比较简单,如果放置几行或几列的话,要使用线性布局嵌套了,然而复制了代码后,提示错误“Unexpected
namespace prefix "xmlns"
found for
tag LinearLayout”,
网上查到删除嵌套里的
xmlns:android=<a target=_blank href="http://schemas.android.com/apk/res/android">http://schemas.android.com/apk/res/android</a>
就OK了。
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" > <Button android:id="@+id/Button1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/Button1" /> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" > <Button android:id="@+id/Button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/Button2" android:layout_weight="1" /> <Button android:id="@+id/Button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/Button3" android:layout_weight="1" /> <Button android:id="@+id/Button4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/Button4" android:layout_weight="1" /> </LinearLayout> </LinearLayout>
相关文章推荐
- 使用C++实现JNI接口需要注意的事项
- Android IPC进程间通讯机制
- Android Manifest 用法
- [转载]Activity中ConfigChanges属性的用法
- Android之获取手机上的图片和视频缩略图thumbnails
- Android之使用Http协议实现文件上传功能
- Android学习笔记(二九):嵌入浏览器
- android string.xml文件中的整型和string型代替
- i-jetty环境搭配与编译
- android之定时器AlarmManager
- android wifi 无线调试
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- android 代码实现控件之间的间距
- android FragmentPagerAdapter的“标准”配置
- Android"解决"onTouch和onClick的冲突问题
- android:installLocation简析
- android searchView的关闭事件
- SourceProvider.getJniDirectories