首页 文章 精选 留言 我的

精选列表

搜索[优化],共10008篇文章
优秀的个人博客,低调大师

Android优化——UI优化(四) 使用stytle

使用style替换背景,防止Activity黑色背景闪过 1.原来的布局 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/img_bg" android:orientation="horizontal"> <Button android:layout_weight="1" android:layout_width="0" android:layout_height="wrap_content" android:text="New Button" android:id="@+id/button2"/> <Button android:layout_weight="1" android:layout_width="0" android:layout_height="wrap_content" android:text="New Button1" android:id="@+id/button3"/> </LinearLayout> 这里我们用了android:background="@drawable/img_bg"来设置了背景图片,但是当我们启动activity是有时候会出现一个黑色的背景,然后才出现我们设置的背景,给用户感觉我们的程序运行的很慢 2.解决办法 <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="android:background">@drawable/img_bg</item> </style> </resources> 我们可以给主题设置一个背景,这样就不会给用户感觉我们的应用卡住了 3.知其然知其所以然 1.因为程序的主题是在程序启动的时候加载 2.Layout中设置的背景实在Activity启动之后才加载 所以会让用户看到一个黑色背景闪过的过程。 本文转自 一点点征服 博客园博客,原文链接: http://www.cnblogs.com/ldq2016/p/5226593.html ,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册