安卓
gaunjia
前端开发专家
python
wechat:guanroonjia
展开
-
安卓学习-(view 方法汇总)
View类是所有可视化控件的基类,主要提供了控件绘制和事务处理的方法。 创建用户界面所使用的控件都继承自View,如EditText、TextView、Button等。 View及其子类的相关属性,既可以在布局XML文件中进行相关设置,也可以通过成员方法在Java代码中动态设置。 View类常用的属性及对应的方法 属性名称 对应方法 描述原创 2017-09-02 16:33:22 · 438 阅读 · 0 评论 -
安卓学习-(滚动布局:RecyclerView)
9、RecyclerView 由于RecyclerView属于新增控件,所以 在app/build.gradle中添加如下代码: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:a原创 2017-09-02 15:18:45 · 389 阅读 · 0 评论 -
安卓学习-(数据存储(文件和SharedPreferences))
1、方式1:使用文件存储 package com.example.filepersistencetest; import android.content.Context; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.text.TextU原创 2017-09-02 15:21:06 · 326 阅读 · 0 评论 -
安卓学习-(数据存储(ORM框架 LitePal))
1、配置LitePal dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:24.2.1' compile 'org.litepal.android:cor原创 2017-09-02 15:24:44 · 327 阅读 · 0 评论 -
安卓学习-(数据存储(数据库,原生sql,和原生安卓操作))
使用原生sql操作数据库 新增数据:db.execSQL("insert into Book (name, author, pages, prices) values (?,?,?,?)", new String[] {"love", "guanjia", "520", "25.5"}); 更新数据:db.execSQL("update Book set price = ? where nam原创 2017-09-02 15:22:13 · 536 阅读 · 0 评论 -
安卓学习- 编写界面(页面布局详解)
1、线性布局 xml version="1.0" encoding="utf-8"?> LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:原创 2017-09-02 15:19:20 · 1396 阅读 · 0 评论 -
安卓学习-(编写界面(常用控件及属性))
1、TextView layout_width="wrap_content" : 当前控件大小刚好能够包裹住内容 --> top、bottom、left、rirht、center,center_vertical, center_horizontal 中间可以用 | 来指定多个; center相当于于center_vertical | center_horizontal-->原创 2017-09-02 15:16:53 · 638 阅读 · 0 评论 -
安卓学习-activity
1、AndroidManifest.xml application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> acti原创 2017-09-02 15:13:48 · 357 阅读 · 0 评论 -
安卓学习-(日志等级, 资源创建和使用)
创建资源:如果是string:在xml中 @+id/button1 引用资源: 不管是什么资源,都可以直接使用@string/hello_world (XML) 或者在java文件中R.string.hello_world (JAVA) 日志的四个等级,两个参数,第一个是tag,用作搜索 Log.v() verbose等级 快捷键logv+tab Log.d() debug等级原创 2017-09-02 15:10:24 · 260 阅读 · 0 评论 -
安卓学习-(滚动布局:ListView)
8、ListView 简单的listview,可以滚动到屏幕外 private String[] data = {"apple", "Orange"}; private List fruitList = new ArrayList(); @Override protected void onCreate(Bundle savedInstanceState) { s原创 2017-09-02 15:17:47 · 336 阅读 · 0 评论