- 博客(11)
- 资源 (8)
- 收藏
- 关注
原创 DataBinding 与 ListView 、RecyclerView 实现数据双向绑定
ListView布局较简单两个Button 一个ListViewLinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pa
2018-01-25 16:08:37 3570 4
原创 DataBinding 绑定点击事件无效解决
DataBinding官方文档按照官方文档绑定点击事件,布局一个button data中定义name 和导入 typelayout xmlns:android="http://schemas.android.com/apk/res/android"> data> variable name="handlers" ty
2018-01-25 14:19:54 4516 3
原创 DataBinding 简单使用
使用条件限制Gradle 版本最低为1.5.0-alpha1Android Studio 版本最低为1.3使用步骤 模块下build.gradleandroid { .... dataBinding { enabled = true }}创建User对象public class User { private String
2018-01-24 17:39:42 260
原创 Android使用WebView与js互调
先看效果图。图中展示了 Android 调用 js中的方法 和 js 调用Android中的方法。布局代码 一个按钮,一个WebViewLinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
2018-01-18 16:18:44 307
原创 Error: One of setGitDir or setWorkTree must be called.
从GitHub上下载了mapbox-android-demo,导入Android Studio 的时候报错更新失败。解决办法在D盘或E盘创建一个文件夹,然后进入该文件夹使用 git clone url 的办法下载项目到该文件夹。然后使用Android Studio 重新导入即可。当然必须得安装Git的。
2018-01-17 11:03:55 2826
原创 Android MapBox集成问题
第一步 依赖。project 下 build.gradle repositories { jcenter() mavenCentral() }moudle 下 build.gradlecompile('com.mapbox.mapboxsdk:mapbox-android-sdk:5.0.2'){ transitive
2018-01-12 14:20:12 1679 1
原创 Android TabLayout 使用
依赖 compile 'com.android.support:design:25.3.1'TabLayout属性app:tabMode="fixed" 固定app:tabMode="scrollable" 可滑动app:tabIndicatorColor 滚动下划线的颜色 app:tabSelectedTextColor tab选中后文
2018-01-09 20:36:26 617
原创 Android中TextInputLayout 使用
首先添加依赖:compile 'com.android.support:design:25.3.1'TextInputLayout继承了LinearLayout,包裹一个EditText。 .support.design.widget.TextInputLayout android:id="@+id/til_password" android:lay
2018-01-08 19:49:02 778
原创 Android 百分比布局
首先引入依赖: compile ‘com.android.support:percent:25.3.1’包中可用的布局为 PercentRelativeLayout 和 PercentFrameLayout 。 PercentRelativeLayout 继承自 RelativeLayout, PercentFrameLayout继承自 FrameLayout 。可用属性:layout_wi
2018-01-04 19:37:28 670 1
原创 Android 帧动画 补间动画 属性动画
Android 中动画分为三种: 1 帧动画 2 补间动画 3 属性动画1 帧动画 FrameAnimation先看图 常用的为xml资源文件方式 res/drawable下创建 animation.xml文件<?xml version="1.0" encoding="utf-8"?><animation-list xmlns:android="http://schem
2018-01-03 19:37:26 408
原创 Java 基本数据类型和操作符整理
1 Java中基本数据类型: 基本类型 大小 最小值 最大值 包装类型 byte 8 bits -2^7 2^7-1 Byte short 16 bits -2^15 2^15 -1 Short char 16 bits Unicode 0 Unicode 2^16 -1 Character int 32 bit
2018-01-02 18:25:10 608
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人