- Android 使用PopupWindow
徐子元竟然被占了!!
Androidandroid
Android使用PopupWindowmainactivity.Javaimportandroid.content.Context;importandroid.content.Intent;importandroid.graphics.drawable.ColorDrawable;importandroid.os.Bundle;importandroid.view.LayoutInflater;
- Resources资源的查找过程
百花鱼藤
以setContentView为列1、Activity.setContentView2、PhoneWindow.setContentView.LayoutInflater.inflate(layoutResID,mContentParent)3、LayoutInflater.inflategetContext().getResources().getLayout(resource)返回XmlRes
- android高级ui01-自定义view-
亢正
学习笔记,整理中摘要面1、layoutparams:xml的属性转换为java用的格式2、面必问:measurespec------------------------------------主要讲自定义viewgroup,viewpager1、所有的xml解析都在layoutinflater里面2、自定义view至少3个构造函数,javanewview调用;xml反射调用;不同主题调用;自定义属
- LayoutInflater源码解析及常见相关报错分析
左大星
Android进阶androidandroidx
在日常Android开发中,最经常使用的RecyclerView控件是大家都绕不开的,而编写其Adapter时更离不开LayoutInflater的调用。当然,如果你做这一行有些时日了,相信你对其使用一定是炉火纯青了。即使如此,我觉得LayoutInflater仍旧有值得分析的地方,相信你看完之后有更多的认识。Android系统中有许多包括ActivityManagerService在内的系统级服
- ViewPager实现最后一个页面出现按钮
LiuZhanYue
一,在布局中引入控件ViewPager和一个按钮先将按钮设置为隐藏二,在Activity中添加布局finalArrayListviews=newArrayList<>();Viewview=LayoutInflater.from(this).inflate(R.layout.item_pop,null);for(inti=1;i<4;i++){views.add(view);}三,适配器(继承Pa
- 14.8 LayoutInflater
jadefly
简介布局管理器,用于加载布局,实例化与LayoutXML文件对应的View对象的系统服务。原理:Android内置的Pull解析器来解析XML布局。使用使用
- Android 自定义BaseFragment
破z晓
android
直接上代码:BaseFragment代码:packagecom.example.custom.fragment;importandroid.content.Context;importandroid.os.Bundle;importandroid.view.LayoutInflater;importandroid.view.View;importandroid.view.ViewGroup;imp
- setContentView()、布局的显示绘制流程、LayoutInflater分析
atmanye
1、setContentView()1.1Activity中,setContentView(),最终是调用到的是PhoneWindow的setContentView()去设置布局。1.2PhoneWindow的setContentView()就是去创建一个DecorView加载系统默认的布局R.layout.screen_simple里面有个id为R.id.content(mContentPare
- reactnative 调用原生UI组件(二),引入xml文件。
小妖怪的夏天
reactnativeuixml
reactnative调用原生UI组件(二),引入xml文件介绍reactnative调用原生的UI组件,引入原生的布局文件(xml)。第一布新建布局文件第二布importandroid.content.Context;importandroid.view.LayoutInflater;importcom.facebook.react.common.MapBuilder.Builder;impor
- Android:AlertDialog自定义对话框
leekey_sjtu
Androidandroidkotlinandroidstudio
Dialog//加载自定义的viewvalview=LayoutInflater.from(this).inflate(R.layout.your_layout,null)valeditText=view.findViewById(R.id.et_dialog)//创建对话框AlertDialog.Builder(this).apply{setTitle("新建列表")//设置标题setView(
- Android开发实用Navigation怎么改变导航栏图标、字体颜色,如何去掉标题栏?请看这里。
No Promises﹉
androidkotlin
1、废话不多,直接上代码:overridefunonCreate(savedInstanceState:Bundle?){super.onCreate(savedInstanceState)binding=ActivityMainBinding.inflate(layoutInflater)setContentView(binding.root)supportActionBar?.hide()va
- Android studio 之 弹窗PopupWindow
YUFENGSHI.LJ
androidstudioandroidstudiogiteeandroid
1.准备弹窗视图popuop_layout.xml2.添加一个按钮3.在按钮的点击事件中设置弹窗实例化PopupWindow对象参数一,用在弹窗中的View(注意不是布局资源id,所以要根据布局资源id转换成view)布局文件xml和视图之间的关系布局文件(.xml文件)定义了UI元素的结构和外观,而View对象则代表了布局中的一个具体的UI元素。通过使用LayoutInflater类,我们可以将
- LayoutInflater 的from传入的context不同会有什么区别?
XuZhenhao0609
android笔记
LayoutInflater.from(context);在Android开发中经常用到,很多年前想了一下,这里的from方法中传递的Context用Activity和Application会不会有什么不同。粗略的看一下源码,发现在from函数中调用的是一个context的抽象方法getSystemService,在ContextWrapper类的实现中又是调用的自己的成员属性mBase的getS
- Android 仿快手视频列表,RecyclerView与Banner联动效果
冰糖葫芦三剑客
Android技术的实现android
这是看到群里讨论过快手APP的一个观看他人视频列表的一个联动效果,但是并不是完全按照这个软件的效果来做的,只是参考,并不是完全仿照这个软件来做的,没时间去优化排版问题了,请见谅,如图:实现效果如下:1.主函数代码:importandroid.os.Bundle;importandroid.view.LayoutInflater;importandroid.view.View;importandro
- React Native 桥接原生原子组件
gxhlh
ReactNativereactnativereact.jsjavascript
一、实现一个原生自定义组件InfoView1、新建一个package包view和一个class类InfoView,InfoView继承自类LinearLayout,LinearLayout类提供了布局管理功能。packagecom.awesomeproject.view;importandroid.content.Context;importandroid.view.LayoutInflater;
- Android将自定义View保存为Bitmap图片
唐诺
代码块BitmapLayoutInFlaterinflate
Android将自定义View保存为Bitmap图片privatevoidcreatePdfImg(){//创建待分享的viewViewview=LayoutInflater.from(getContext()).inflate(R.layout.ecg_pdf_view,null);PdfEcgWaveViewwaveView=view.findViewById(R.id.ecg_wave_vi
- 安卓开发之关于如何用viewPager实现三种不同效果的轮播图
不过是条河鱼
安卓android
还是因为课程设计的缘故,想美化一下界面就想着实现一个轮播图。本文展示了三种效果的轮播图供大家交流,话不多说,直接上代码。目录最简单的效果无边界的效果带有导航点的效果最简单的效果项目构成逻辑代码importandroid.os.Bundle;importandroid.os.Handler;importandroid.view.LayoutInflater;importandroid.view.Vi
- DialogFragment中通过dataBinding绑定View,设置点击事件无效,通过getWindow设置dialog位置和大小无效。
安卓更新太快了
Bug杂谈androidkotlin开发语言
1、问题描述:DialogFragment中通过dataBinding绑定View,设置点击事件无效。privatevalbinding:CoreDialogEditContentBindingbylazy{CoreDialogEditContentBinding.inflate(mContext.layoutInflater)}privatefuninitWindowView(){valview
- Android系列-LayoutInflater 几个 inflate方法的区别
lostfish123
Androidandroid
(来自chatgpt的回答)LayoutInflater提供了多个inflate方法,用于将XML布局文件解析为相应的视图对象。这些方法的主要区别在于参数的组合和用途。以下是常见的几个inflate方法及其区别:1.inflate(intresource,ViewGrouproot)//frameworks\base\core\java\android\view\LayoutInflater.ja
- A factory has already been set on this LayoutInflater问题解决
坑逼的严
说一说setFactory方法,他有两种一是LayoutInflater二是LayoutInflaterCompat,顾名思义LayoutInflaterCompat是兼容包为什么有这个兼容包呢?给大家一个网址,上面写的很清楚,结合源码看更容易理解:http://www.apkbus.com/thread-258751-1-1.html?_dsign=e8073ac8大部分人用这个实现了换肤功能,
- Android 一分钟使用RecyclerView完美实现瀑布
冰糖葫芦三剑客
android
【免费】安卓RecyclerView瀑布流效果实现资源-CSDN文库1.WaterfallFlowActivity主函数代码:packagecom.example.mytestapplication;importandroid.os.Bundle;importandroid.util.Log;importandroid.view.LayoutInflater;importandroid.widge
- Android AlertDialog提高中心位置往上,Kotlin
zhangphil
kotlinAndroidandroidkotlin
AndroidAlertDialog提高中心位置往上,Kotlinprivatefunshow(){valview=LayoutInflater.from(this).inflate(android.R.layout.simple_list_item_1,null)valtext=view.findViewById(android.R.id.text1)text.text="hello,world
- 自定义 按钮间,按钮边框滑动。
qq_28909387
kotlinandroid自定义效果自定义控件
先是布局界面然后是几个样式文件。另一个border_button_background使用代码classYourFragment:Fragment(){privatevarselectedButton:Button?=nulloverridefunonCreateView(inflater:LayoutInflater,container:ViewGroup?,savedInstanceState
- 属性填充错误问题
吉凶以情迁
android.view.InflateException:BinaryXMLfileline#0:Errorinflatingclassatandroid.view.LayoutInflater.createView(LayoutInflater.java:620)atcom.android.internal.policy.impl.PhoneLayoutInflater.onCreateVie
- ListView+BaseAdapter实现电话簿
365JHWZGo
androidstudio
packagexdglyt.software.jhwz.myapplicationlistview;importandroidx.appcompat.app.AppCompatActivity;importandroid.content.res.Resources;importandroid.os.Bundle;importandroid.view.LayoutInflater;importand
- inflate方法参数意义
小院里栽棵树
inflate(intresource,ViewGrouproot,booleanattachToRoot)resource:资源idroot:容器attachToRoot:是否添加入容器再聊每个参数的具体作用之前,我们先看下inflate的几种常用写法layoutInflater.inflate(R.layout.xx,null)layoutInflater.inflate(R.layout.x
- 安卓PopupWindow的拖动实现
断浪天涯
安卓前端
安卓PopupWindow的拖动实现源码:packagecom.example.popwindowdemo;importandroid.content.Context;importandroid.view.Gravity;importandroid.view.LayoutInflater;importandroid.view.MotionEvent;importandroid.view.View;
- Kotlin语言实现单击任意TextVIew切换一个新页面,并且实现颜色变换
晚风时亦鹿
Androidstudio(竞赛及平常项目)androidstudio
创建一个新包color功能页classMainActivity2:AppCompatActivity(){privatelateinitvarfragmentManager:FragmentManagerprivatevalbindingbylazy{ActivityMain2Binding.inflate(layoutInflater)}overridefunonCreate(savedInst
- Android设计模式-1-单例模式
今阳
Android设计模式设计模式android单例模式java
1.定义:确保1个类只有1个实例化对象,提供一个全局访问点2.优缺点优点:客户端使用单例模式的实例的时候,只需要调用一个单一的方法即可生成一个唯一的实例,有利于节约资源。缺点:首先单例模式很难实现序列化,这就导致采用单例模式的类很难被持久化,当然也很难通过网络传输;其次由于单例采用静态方法,无法在继承结构中使用。3.android源码中的体现:例如,加载布局时经常要创建LayoutInflater
- 《第一行代码》 随手笔记——第三章 UI开发的点点滴滴
Richard_tan0113
3.5.3提升ListView的运行效率1、Viewview;if(convertView==null){view=LayoutInflater.from(getContext()).inflate(resourceId,null);}else{view=convertView;}2、每次在getView()方法中还是会调用View的findViewById()方法来获取一次控件的实例。我们可以借
- tomcat基础与部署发布
暗黑小菠萝
Tomcat java web
从51cto搬家了,以后会更新在这里方便自己查看。
做项目一直用tomcat,都是配置到eclipse中使用,这几天有时间整理一下使用心得,有一些自己配置遇到的细节问题。
Tomcat:一个Servlets和JSP页面的容器,以提供网站服务。
一、Tomcat安装
安装方式:①运行.exe安装包
&n
- 网站架构发展的过程
ayaoxinchao
数据库应用服务器网站架构
1.初始阶段网站架构:应用程序、数据库、文件等资源在同一个服务器上
2.应用服务和数据服务分离:应用服务器、数据库服务器、文件服务器
3.使用缓存改善网站性能:为应用服务器提供本地缓存,但受限于应用服务器的内存容量,可以使用专门的缓存服务器,提供分布式缓存服务器架构
4.使用应用服务器集群改善网站的并发处理能力:使用负载均衡调度服务器,将来自客户端浏览器的访问请求分发到应用服务器集群中的任何
- [信息与安全]数据库的备份问题
comsci
数据库
如果你们建设的信息系统是采用中心-分支的模式,那么这里有一个问题
如果你的数据来自中心数据库,那么中心数据库如果出现故障,你的分支机构的数据如何保证安全呢?
是否应该在这种信息系统结构的基础上进行改造,容许分支机构的信息系统也备份一个中心数据库的文件呢?
&n
- 使用maven tomcat plugin插件debug关联源代码
商人shang
mavendebug查看源码tomcat-plugin
*首先需要配置好'''maven-tomcat7-plugin''',参见[[Maven开发Web项目]]的'''Tomcat'''部分。
*配置好后,在[[Eclipse]]中打开'''Debug Configurations'''界面,在'''Maven Build'''项下新建当前工程的调试。在'''Main'''选项卡中点击'''Browse Workspace...'''选择需要开发的
- 大访问量高并发
oloz
大访问量高并发
大访问量高并发的网站主要压力还是在于数据库的操作上,尽量避免频繁的请求数据库。下面简
要列出几点解决方案:
01、优化你的代码和查询语句,合理使用索引
02、使用缓存技术例如memcache、ecache将不经常变化的数据放入缓存之中
03、采用服务器集群、负载均衡分担大访问量高并发压力
04、数据读写分离
05、合理选用框架,合理架构(推荐分布式架构)。
- cache 服务器
小猪猪08
cache
Cache 即高速缓存.那么cache是怎么样提高系统性能与运行速度呢?是不是在任何情况下用cache都能提高性能?是不是cache用的越多就越好呢?我在近期开发的项目中有所体会,写下来当作总结也希望能跟大家一起探讨探讨,有错误的地方希望大家批评指正。
1.Cache 是怎么样工作的?
Cache 是分配在服务器上
- mysql存储过程
香水浓
mysql
Description:插入大量测试数据
use xmpl;
drop procedure if exists mockup_test_data_sp;
create procedure mockup_test_data_sp(
in number_of_records int
)
begin
declare cnt int;
declare name varch
- CSS的class、id、css文件名的常用命名规则
agevs
JavaScriptUI框架Ajaxcss
CSS的class、id、css文件名的常用命名规则
(一)常用的CSS命名规则
头:header
内容:content/container
尾:footer
导航:nav
侧栏:sidebar
栏目:column
页面外围控制整体布局宽度:wrapper
左右中:left right
- 全局数据源
AILIKES
javatomcatmysqljdbcJNDI
实验目的:为了研究两个项目同时访问一个全局数据源的时候是创建了一个数据源对象,还是创建了两个数据源对象。
1:将diuid和mysql驱动包(druid-1.0.2.jar和mysql-connector-java-5.1.15.jar)copy至%TOMCAT_HOME%/lib下;2:配置数据源,将JNDI在%TOMCAT_HOME%/conf/context.xml中配置好,格式如下:&l
- MYSQL的随机查询的实现方法
baalwolf
mysql
MYSQL的随机抽取实现方法。举个例子,要从tablename表中随机提取一条记录,大家一般的写法就是:SELECT * FROM tablename ORDER BY RAND() LIMIT 1。但是,后来我查了一下MYSQL的官方手册,里面针对RAND()的提示大概意思就是,在ORDER BY从句里面不能使用RAND()函数,因为这样会导致数据列被多次扫描。但是在MYSQL 3.23版本中,
- JAVA的getBytes()方法
bijian1013
javaeclipseunixOS
在Java中,String的getBytes()方法是得到一个操作系统默认的编码格式的字节数组。这个表示在不同OS下,返回的东西不一样!
String.getBytes(String decode)方法会根据指定的decode编码返回某字符串在该编码下的byte数组表示,如:
byte[] b_gbk = "
- AngularJS中操作Cookies
bijian1013
JavaScriptAngularJSCookies
如果你的应用足够大、足够复杂,那么你很快就会遇到这样一咱种情况:你需要在客户端存储一些状态信息,这些状态信息是跨session(会话)的。你可能还记得利用document.cookie接口直接操作纯文本cookie的痛苦经历。
幸运的是,这种方式已经一去不复返了,在所有现代浏览器中几乎
- [Maven学习笔记五]Maven聚合和继承特性
bit1129
maven
Maven聚合
在实际的项目中,一个项目通常会划分为多个模块,为了说明问题,以用户登陆这个小web应用为例。通常一个web应用分为三个模块:
1. 模型和数据持久化层user-core,
2. 业务逻辑层user-service以
3. web展现层user-web,
user-service依赖于user-core
user-web依赖于user-core和use
- 【JVM七】JVM知识点总结
bit1129
jvm
1. JVM运行模式
1.1 JVM运行时分为-server和-client两种模式,在32位机器上只有client模式的JVM。通常,64位的JVM默认都是使用server模式,因为server模式的JVM虽然启动慢点,但是,在运行过程,JVM会尽可能的进行优化
1.2 JVM分为三种字节码解释执行方式:mixed mode, interpret mode以及compiler
- linux下查看nginx、apache、mysql、php的编译参数
ronin47
在linux平台下的应用,最流行的莫过于nginx、apache、mysql、php几个。而这几个常用的应用,在手工编译完以后,在其他一些情况下(如:新增模块),往往想要查看当初都使用了那些参数进行的编译。这时候就可以利用以下方法查看。
1、nginx
[root@361way ~]# /App/nginx/sbin/nginx -V
nginx: nginx version: nginx/
- unity中运用Resources.Load的方法?
brotherlamp
unity视频unity资料unity自学unityunity教程
问:unity中运用Resources.Load的方法?
答:Resources.Load是unity本地动态加载资本所用的方法,也即是你想动态加载的时分才用到它,比方枪弹,特效,某些实时替换的图像什么的,主张此文件夹不要放太多东西,在打包的时分,它会独自把里边的一切东西都会集打包到一同,不论里边有没有你用的东西,所以大多数资本应该是自个建文件放置
1、unity实时替换的物体即是依据环境条件
- 线段树-入门
bylijinnan
java算法线段树
/**
* 线段树入门
* 问题:已知线段[2,5] [4,6] [0,7];求点2,4,7分别出现了多少次
* 以下代码建立的线段树用链表来保存,且树的叶子结点类似[i,i]
*
* 参考链接:http://hi.baidu.com/semluhiigubbqvq/item/be736a33a8864789f4e4ad18
* @author lijinna
- 全选与反选
chicony
全选
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>全选与反选</title>
- vim一些简单记录
chenchao051
vim
mac在/usr/share/vim/vimrc linux在/etc/vimrc
1、问:后退键不能删除数据,不能往后退怎么办?
答:在vimrc中加入set backspace=2
2、问:如何控制tab键的缩进?
答:在vimrc中加入set tabstop=4 (任何
- Sublime Text 快捷键
daizj
快捷键sublime
[size=large][/size]Sublime Text快捷键:Ctrl+Shift+P:打开命令面板Ctrl+P:搜索项目中的文件Ctrl+G:跳转到第几行Ctrl+W:关闭当前打开文件Ctrl+Shift+W:关闭所有打开文件Ctrl+Shift+V:粘贴并格式化Ctrl+D:选择单词,重复可增加选择下一个相同的单词Ctrl+L:选择行,重复可依次增加选择下一行Ctrl+Shift+L:
- php 引用(&)详解
dcj3sjt126com
PHP
在PHP 中引用的意思是:不同的名字访问同一个变量内容. 与C语言中的指针是有差别的.C语言中的指针里面存储的是变量的内容在内存中存放的地址 变量的引用 PHP 的引用允许你用两个变量来指向同一个内容 复制代码代码如下:
<?
$a="ABC";
$b =&$a;
echo
- SVN中trunk,branches,tags用法详解
dcj3sjt126com
SVN
Subversion有一个很标准的目录结构,是这样的。比如项目是proj,svn地址为svn://proj/,那么标准的svn布局是svn://proj/|+-trunk+-branches+-tags这是一个标准的布局,trunk为主开发目录,branches为分支开发目录,tags为tag存档目录(不允许修改)。但是具体这几个目录应该如何使用,svn并没有明确的规范,更多的还是用户自己的习惯。
- 对软件设计的思考
e200702084
设计模式数据结构算法ssh活动
软件设计的宏观与微观
软件开发是一种高智商的开发活动。一个优秀的软件设计人员不仅要从宏观上把握软件之间的开发,也要从微观上把握软件之间的开发。宏观上,可以应用面向对象设计,采用流行的SSH架构,采用web层,业务逻辑层,持久层分层架构。采用设计模式提供系统的健壮性和可维护性。微观上,对于一个类,甚至方法的调用,从计算机的角度模拟程序的运行情况。了解内存分配,参数传
- 同步、异步、阻塞、非阻塞
geeksun
非阻塞
同步、异步、阻塞、非阻塞这几个概念有时有点混淆,在此文试图解释一下。
同步:发出方法调用后,当没有返回结果,当前线程会一直在等待(阻塞)状态。
场景:打电话,营业厅窗口办业务、B/S架构的http请求-响应模式。
异步:方法调用后不立即返回结果,调用结果通过状态、通知或回调通知方法调用者或接收者。异步方法调用后,当前线程不会阻塞,会继续执行其他任务。
实现:
- Reverse SSH Tunnel 反向打洞實錄
hongtoushizi
ssh
實際的操作步驟:
# 首先,在客戶那理的機器下指令連回我們自己的 Server,並設定自己 Server 上的 12345 port 會對應到幾器上的 SSH port
ssh -NfR 12345:localhost:22
[email protected]
# 然後在 myhost 的機器上連自己的 12345 port,就可以連回在客戶那的機器
ssh localhost -p 1
- Hibernate中的缓存
Josh_Persistence
一级缓存Hiberante缓存查询缓存二级缓存
Hibernate中的缓存
一、Hiberante中常见的三大缓存:一级缓存,二级缓存和查询缓存。
Hibernate中提供了两级Cache,第一级别的缓存是Session级别的缓存,它是属于事务范围的缓存。这一级别的缓存是由hibernate管理的,一般情况下无需进行干预;第二级别的缓存是SessionFactory级别的缓存,它是属于进程范围或群集范围的缓存。这一级别的缓存
- 对象关系行为模式之延迟加载
home198979
PHP架构延迟加载
形象化设计模式实战 HELLO!架构
一、概念
Lazy Load:一个对象,它虽然不包含所需要的所有数据,但是知道怎么获取这些数据。
延迟加载貌似很简单,就是在数据需要时再从数据库获取,减少数据库的消耗。但这其中还是有不少技巧的。
二、实现延迟加载
实现Lazy Load主要有四种方法:延迟初始化、虚
- xml 验证
pengfeicao521
xmlxml解析
有些字符,xml不能识别,用jdom或者dom4j解析的时候就报错
public static void testPattern() {
// 含有非法字符的串
String str = "Jamey친ÑԂ
- div设置半透明效果
spjich
css半透明
为div设置如下样式:
div{filter:alpha(Opacity=80);-moz-opacity:0.5;opacity: 0.5;}
说明:
1、filter:对win IE设置半透明滤镜效果,filter:alpha(Opacity=80)代表该对象80%半透明,火狐浏览器不认2、-moz-opaci
- 你真的了解单例模式么?
w574240966
java单例设计模式jvm
单例模式,很多初学者认为单例模式很简单,并且认为自己已经掌握了这种设计模式。但事实上,你真的了解单例模式了么。
一,单例模式的5中写法。(回字的四种写法,哈哈。)
1,懒汉式
(1)线程不安全的懒汉式
public cla