社区
Android
帖子详情
无法加载layout中页面的预览
fordz
2017-10-27 11:09:28
求助,昨天更新了Android Studio的新版本后,layout中的页面预览一直处在waiting for build to finish的状态中,之前一直没有问题,请问是否版本兼容的问题?谢谢你们的回复。
...全文
532
3
打赏
收藏
无法加载layout中页面的预览
求助,昨天更新了Android Studio的新版本后,layout中的页面预览一直处在waiting for build to finish的状态中,之前一直没有问题,请问是否版本兼容的问题?谢谢你们的回复。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
fordz
2017-11-05
打赏
举报
回复
的确是版本升级后没有更新工具所致,谢谢你们的帮助
moonFY
2017-10-30
打赏
举报
回复
每个 版本 更新 后 是否 将所有相应的工具都进行更新了, 不确定 就打开settings 的update check 一下 保证所有工具都最新,那就没问题了。 以上说的是
正式版本
,如果是
预览版本
可能是Google 还没有更新相应工具。
qingtian1397
2017-10-28
打赏
举报
回复
请处理好gradle。都碰到过这种状况。
Android
中
WebView
加载
网页设置进度条
我们平时在进行安卓开发使用到webview
加载
网页时,我们不能准确了解网页的
加载
进度,因此为了提高用户体验,我们在webview
中
加入进度条显示
加载
进度。 程序
预览
界面: 一、主界面xml布局文件 <Linear
Layout
xmlns:android=http://schemas.android.com/apk/res/android xmlns:tools=http://schemas.android.com/tools android:
layout
_width=match_parent android:
layout
_height=match_parent to
Loading
Layout
Demo-
加载
中
、无网络、无数据、出错4种状态的载入布局.zip
前言项目里都会遇到几种
页面
,分别为
加载
中
、无网络、无数据、出错四种情况,经常要使用,所以封成库引用了,方便使用,顺便分享出来。先看一下效果: 原理比较简单,继承Frame
Layout
,在xml渲染完成后,加上
加载
中
、无网络、无数据、出错四个
页面
,根据需要控制显示哪一层,花了些时间,开了很多方法出来,支持很多属性的设置,算是比较实用,源码里已对各个方法的作用都加了注释,就不做过多解释了,项目GitHub地址:https://github.com/weavey/Loading
Layout
Demo,感兴趣的可以看看,欢迎指出问题。使用方式gradle引用:compile 'com.lai.weavey:loading
layout
:1.2'使用说明Loading
Layout
支持全局配置,对所有使用到的地方都起效,需要在Application
中
配置,如下: public class App extends Application { @Override public void onCreate() { super.onCreate(); Loading
Layout
.getConfig() .setErrorText("出错啦~请稍后重试!") .setEmptyText("抱歉,暂无数据") .setNoNetworkText("无网络连接,请检查您的网络···") .setErrorImage(R.mipmap.define_error) .setEmptyImage(R.mipmap.define_empty) .setNoNetworkImage(R.mipmap.define_nonetwork) .setAllTipTextColor(R.color.gray) .setAllTipTextSize(14) .setReloadButtonText("点我重试哦") .setReloadButtonTextSize(14) .setReloadButtonTextColor(R.color.gray) .setReloadButtonWidthAndHeight(150,40); } }由于“
加载
中
”的
页面
,可能每个App都不一样,因此,Loading
Layout
支持自定义LoadingPage,如下: Loading
Layout
.getConfig() .setLoadingPage
Layout
(R.
layout
.define_loading_page);同时,为了适应个别界面的“特殊需求”,Loading
Layout
也支持局部设置各种属性,仅对当前对象生效,不影响全局。如下: Loading
Layout
loading = (Loading
Layout
) findViewById(R.id.loading_
layout
); loading.setLoadingPage(R.
layout
.define_loading_page) .setEmptyText("暂无报告数据") .setErrorText("") .setNoNetworkText("") .setErrorImage(R.mipmap.ic_launcher) .setErrorTextSize(16) .setReloadButtonText("点我重新
加载
哦"); //等等为ReloadButton设置监听:loading
Layout
.setOnReloadListener(new Loading
Layout
.OnReloadListener() { @Override public void onReload(View v) { } });设置显示的
页面
: loading
Layout
.setStatus(Loading
Layout
.Loading);//
加载
中
loading
Layout
.setStatus(Loading
Layout
.Empty);//无数据 loading
Layout
.setStatus(Loading
Layout
.Error);//错误 loading
Layout
.setStatus(Loading
Layout
.No_Network);//无网络 loading
Layout
.setStatus(Loading
Layout
.Success);//
加载
成功最后,在xml里面使用:
Layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:
layout
_width="match_parent" android:
layout
_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" app:isFirstVisible="true">
layout_width="match_parent" android:
layout
_height="match_parent" android:text="ContentView"/>
Layout>注意: (1)isFirstVisible属性用来控制contentView一开始是否隐藏,由于Loading
Layout
原理是在xml渲染完成后在contentView上铺上三层View,因此,一开始如果不隐藏,等contentView渲染完成后调用: loading
Layout
.setStatus(Loading
Layout
.Loading); 会造成界面闪烁的效果,影响体验,因此默认将contentView隐藏,所以数据
加载
完成后一定要调用loading
Layout
.setStatus(Loading
Layout
.Success);,将contentView显示出来。这样也能解决未获取到数据的情况下,被用户看到杂乱无章的布局,个人还是比较喜欢默认隐藏contentView; (2)为了方便管理,Loading
Layout
只能有一个直属子View,类似ScrollView,添加两个直属子View会抛出异常throw new IllegalStateException("Loading
Layout
can host only one direct child");; (3)由于AS会直接将自定义View的特性反应在
预览
界面,所以在使用Loading
Layout
的时候,会
无法
看到被Loading
Layout
包裹住的布局(默认为gone),因此也可以将isFirstVisible属性暂时设为true,
预览
布局。
Java
中
的日志系统
本课程讲师为清华硕士,曾就职于甲骨文等多家知名IT公司,有丰富的开发实战经验,内容条理,讲解清晰,声音甜美。内容包括从Java
中
的日志系统(1),(2),(3)三部分内容。时长(分):75视频频内容:1.从Log4j的使用讲起: Log4j的工作原理 Log4j
中
的日志器Logger Log4j
中
的扩展器Appender Log4j
中
的布局器
Layout
在工程
中
加载
Log4j Log4j的配置实例2.常见的Commons-logging Commons-logging的原因 Commons-logging的工作原理 Commons-logging的实例3.强大的slf4j Slf4j的原因及场景 Slf4j的工作原理 Slf4j的实例视频特点:原创,多年经验总结,精选最具价值实用技法,短小精干。视频
预览
版网址:http://you.video.sina.com.cn/vlist/1228202454.html
vue路由前进后退动画效果的实现代码
vue-route-transition vue router 切换动画 特性 模拟前进后退动画 基于css3流畅动画 基于sessionStorage,
页面
刷新不影响路由记录 路由懒
加载
,返回可记录滚动条位置 前进后退的判断与路由路径规则无关 支持任意基于Vue的UI框架 demo 手机扫码 在线
预览
说明 配套包含两个组件 vue-route-transition 负责动画 router-
layout
负责
页面
排版。 主要是解决transform动画,position:fixed异常问题 像往常一样使用 npm i vue-route-transit
mini-SSG:Mini SSG(静态站点生成器),语法简洁美观
迷你SSG 简单的静态站点生成器,以防止您使用最少的语法编写 DRY HTML 文件使用 Node.js 构建受 Laravel Blade 模板和 Sergey.cool SSG 的启发 更新/日志v 0.2.2: 添加 livereload,运行 npm run dev,当发生变化时会自动重新
加载
浏览器v 0.2.1:错误修复:允许部分值包括“逗号符号” v 0.1.9:所有静态资产都存在于“dev/static”
中
。 用例 对于使用大量 html 文件和许多重用组件(页眉、页脚等)或想要使用一般布局的人 为什么以及如何使用它 查看 语法
预览
导入
页面
@import(header)
Your awesome content
@import(footer) 使用一般布局 @
layout
(base) @section(title, Your Page Title)
Android
80,349
社区成员
91,287
社区内容
发帖
与我相关
我的任务
Android
移动平台 Android
复制链接
扫一扫
分享
社区描述
移动平台 Android
android
android-studio
androidx
技术论坛(原bbs)
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章