- OC语言多界面传值五大方式
Magnetic_h
iosui学习objective-c开发语言
前言在完成暑假仿写项目时,遇到了许多需要用到多界面传值的地方,这篇博客来总结一下比较常用的五种多界面传值的方式。属性传值属性传值一般用前一个界面向后一个界面传值,简单地说就是通过访问后一个视图控制器的属性来为它赋值,通过这个属性来做到从前一个界面向后一个界面传值。首先在后一个界面中定义属性@interfaceBViewController:UIViewController@propertyNSSt
- iOS 多视图UIView左右来回滑动切换效果
Andyjicw
iOS移动开发ios滑动uiview效果
多视图页面左右来回滑动切换效果!////ViewController.h//demoA0////Createdbyyuhangon13-2-18.//Copyright(c)2013年yuhang.Allrightsreserved.//#import#defineViewNumber10@interfaceViewController:UIViewController{UIView*dwView
- MVC设计模式与delegate
摘星星ʕ•̫͡•ʔ
swiftiosswift
一、MVCMVC就是Model(模型)、View(视图)、Controller(控制器)例如上面的excel表,数据、数据结构就是模型Model根据数据形成的直观的、用户能直接看见的柱形图是视图View数据构成的表格就是控制器Controller,改变表格中的数据、属性等柱形图就会随之变化,控制了视图的变化,所以叫控制器。View通过delegate向UIViewController报告事件的发生
- IOS 动画 动态变换背景色和大小
SkTj
1importUIKit23classViewController:UIViewController{45overridefuncviewDidLoad(){6super.viewDidLoad()7//Doanyadditionalsetupafterloadingtheview,typicallyfromanib.8letrect=CGRect(x:40,y:80,width:240,heig
- SwiftSiriWaveformView 使用教程
马安柯Lorelei
SwiftSiriWaveformView使用教程SwiftSiriWaveformViewAUIViewsubclassthatreproducesthewaveformeffectseeninSirioniOS7+.ItisaSwiftadaptationoftheamazingSCSiriWaveformViewbyStefanCeriu.项目地址:https://gitcode.com/g
- 属性和成员变量
Rumbles
1.现在的编译器@interfaceGBViewController:UIViewController@property(nonatomic,strong)NSString*myString;@end这是编译器会给我们默认生成getter/setter方法而且还会生成_myString的成员变量以前属性的正常写法需要成员变量+@property+@synthesize成员变量三个步骤@interf
- 获取UIBarItem的frame(UITabBarItem,UIBarButtonItem)
山已几孑
获取UIBarItem的frame,比在Bar的subViews里面遍历好很多,废话不多说extensionUIBarItem{varframe:CGRect{guardletitemView=self.value(forKey:"view")as?UIViewelse{return.zero}//itemView.backgroundColor=UIColor.redreturnitemView
- 封装了一个iOS 分页嵌套滚动框架
刘小哈哈哈
ioscocoamacos
嵌套滚动的原理有一个smoothView,(继承于UIView),里面包含一个横向滚动的collectionView1有一个头部容器视图,头部容器视图包含头部视图和分页菜单总体是一个横向的collectionView,有多少个分页,就有多少个cell这个cell的大小就是整个页面的大小,cell上面放了一个控制器的view,控制器的view上面放了单个的纵向滚动的视图,则初始化的状态下,纵向滚动的
- collectionViewCell防止复用的两种方法
suiyuechenglao
collectionViewiOScollectionView复用
collectionView防止cell复用的方法一://在创建collectionView的时候注册cell(一个分区)UICollectionViewCell*cell=[collectionViewdequeueReusableCellWithReuseIdentifier:@“cell"forIndexPath:indexPath];for(UIView*viewincell.conten
- IOS 设置UIViewController为背景半透明浮层弹窗,查看富文本图片详情
OKXLIN
ioshtmlWKWebViewOC富文本图片
使用场景:UIViewController1打开UIViewController2(背景半透明弹窗)案例:打开富文本网页图片的url查看图片详情WKWebViewWKNavigationDelegate代理方法设置js代码点击事件///注册添加图片标签点击js方法-(void)webView:(WKWebView*)webViewdidFinishNavigation:(WKNavigation*
- (IOS)移除所有的子视图
rightmost
-(void)removeAllSubviews{while(self.subviews.count){UIView*child=self.subviews.lastObject;[childremoveFromSuperview];}}
- 较为实用的几种传值方法
雅风丶
最简单的AB面正向传值应用场景登录获取账号,昵称实现方法设置第一个界面首先在第一个界面创建好一个TextFeild,用来获取我们要传的文字importUIKitclassViewController:UIViewController{lettextField=UITextField()overridefuncviewDidLoad(){super.viewDidLoad()self.view.ba
- iOS总体框架介绍和详尽说明
诗雅颂
ios移动端框架苹果
iOS是由苹果公司开发的移动操作系统,为iPhone、iPad、iPodTouch等设备提供支持。iOS采用了基于Unix的核心(称为Darwin),并采用了类似于MacOSX的图形用户界面。以下是iOS的总体框架介绍和详尽说明:UIKit框架:UIKit是构建iOS应用程序用户界面的主要框架。它包括了各种视图控制器(如UITableViewController、UIViewController)
- iOS 圆角和阴影并存的方法
freesan44
前提圆角和阴影无法共存的原因就是因为这句代码。BecauseshadowisaneffectdoneoutsidetheView,andthatmasksToBoundssettoYESwilltelltheUIViewnottodraweverythingthatisoutsideitself.这句话的意思就是,圆角都是我给你割出来的,圆角外面的阴影自然也割掉了~所以,这么看来,圆角与阴影不能并
- whose view is not in the window hierarchy 解决方法
那片飘落的树叶
新到的公司,要求马上改BUG,ios11跳转相机崩溃,于是我添加了隐私权限,还是出现UI界面错乱问题,还有提示上面的信息,修改放方法:UIViewController*topRootViewController=[[UIApplicationsharedApplication]keyWindow].rootViewController;//在这里加一个这个样式的循环while(topRootVie
- 【iOS 1 行代码系列】之 一行代码解耦控制器UIViewController
豪冷
实现原理:NSClassFromString()KVC新建分类,重写方法:-(void)setValue:(id)valueforUndefinedKey:(NSString*)key防止崩溃地址:JHUIViewControllerDecoupler:https://github.com/xjh093/JHUIViewControllerDecoupler///string->controlle
- UI状态保存和恢复(二)
沐灵洛
UI状态保存和恢复(二)上篇我们介绍了UI状态保存和恢复的流程,UIStateRestoration协议类的方法,适用场景,调试策略以及UIApplication、UIViewController、UIView关于UIStateRestoration协议所提供的接口方法。本篇文章将介绍我们如何实现UI状态保存和恢复。在AppDelegate.m中设置UI的状态可以恢复和保存。-(BOOL)appl
- [译] iOS设计规范:应用结构三
篱落LY
模态强制在界面上显示内容,可以使用户专注于完成某项任务前不受干扰。操作表、提示框、活动视图都提供模式体验。当屏幕上出现模态视图时,即表示进入了模式体验。在模式体验中,用户必须要进行点击按钮等操作来退出体验。一些应用是支持模态视图功能,例如日历中编辑事件的操作、在浏览器中选择书签的操作。模态视图,可以是满屏显示的也可以不满屏显示。模态视图,一般包括完成和取消按钮。*UIViewController类
- iOS Swift Timer的销毁问题以及优化
程序员june
IOSiosswifttimer定时器
最近在同事的代码里看到了一些定时器使用上的问题,其实Timer虽然用起来看似很简单,但是稍不注意就会出现问题,造成一些偶发性的崩溃。下面这个是常见的写法,看似没问题,其实deinit方法是不会被调用的,Timer自然不会被销毁。classTimerTestViewController:UIViewController{@IBOutletweakvarlabelText:UILabel!varmyT
- JPGradient:可设置渐变背景色、文字色的控件(包括 UIView、UILabel、UIButton)
健了个平_24
Demo使用letgLabel:GradientLabel={letlabel=GradientLabel(frame:CGRect(x:50,y:100,width:300,height:100))returnlabel}()letgBtn:GradientButton={letbtn=GradientButton(type:.system)btn.frame=CGRect(x:50,y:200
- popupwindow 实现搜索历史列表
吃啥呀
kotlin配合searchviewlistpopupwindow开始的代码classSearchActivity:AppCompatActivity(),SearchContract.SearchUIView{privatelateinitvarsearchView:SearchViewprivatelateinitvarhistoryRecord:MutableListprivatelatei
- iOS UICollectionView 详解
我会回来的
importUIKit////////ViewController.swift////test////////CreatedbyMacon2023/5/30.//////importUIKitclassViewController:UIViewController,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionVie
- iOS13相关适配
高思阳
Q:我不想让用户使用DarkMode,可不可以?A:当然可以,请往下看在iOS13,为UIViewController和UIView扩展了一个新的API-overrideUserInterfaceStyle,使用方法,官方文档大致是这么说的:通过设置overrideUserInterfaceStyle属性以使该视图及其子视图具有特定的UIUserInterfaceStyle。但如果想要获取当前的U
- Swift-UIKit-UILabel
Vicent_Z
1.描述classUILabel:UIViewUILabel继承自UIView苹果官方文档:Aviewthatdisplaysoneormorelinesofinformationaltext.(是一个描述一行或者多行文本信息的视图)UILabel支持展示属性字符串(attributedstrings).并且支持多行展示,如果设置好约束,还可以进行高度的自适应.UILabel大多通过NSStrin
- iOS开发:浅谈响应链与事件传递
MiniCoder
基本概念响应者:在iOS中,响应者为能响应事件的UIResponder子类对象,如UIButton、UIView等。响应链:响应链是由链接在一起的响应者(UIResponse子类)组成的。默认情况下,响应链是由第一响应者,到application对象以及中间所有响应者一起组成的。事件传递:获得响应链后,将事件由第一响应者往application传递的过程即为事件传递。14477290-74a39a
- 设计模式
灰溜溜的小王子
一、编程中的六大设计原则?1.单一职责原则通俗地讲就是一个类只做一件事1.CALayer:动画和视图的显示。2.UIView:只负责事件传递、事件响应。2.开闭原则对修改关闭,对扩展开放。要考虑到后续的扩展性,而不是在原有的基础上来回修改3.接口隔离原则使用多个专门的协议、而不是一个庞大臃肿的协议,例如tableView的代理和数据源代理:UITableviewDelegate,UITableVi
- iOS Swift 圆环进度条
rome753
截屏2022-03-07上午10.16.41.png用CAShapeLayer和UIBezierPath贝塞尔曲线实现,每次进度变化时,重新初始化一个CAShapeLayer添加到当前UIView上。importFoundationimportUIKitclassCircleProgressView:UIView{//灰色静态圆环varstaticLayer:CAShapeLayer!//进度可变
- 使用 Auto Layout
大菠萝_DABLO
前言原本好久没有写过UI了。最近新版本写了一大波UI。可能由于我是从Storyboard开始接触iOS开发的,所以对AutoLayout有着深厚的情感。这次趁着手热写一篇文章,希望能对准备使用和正在使用AutoLayout的各位有所帮助。1、关于AutoLayoutAutoLayout做了什么UIView的展示区域是由center和size来决定的。拆开就是4个实数:centerX,centerY
- iOS UIAlertController增加输入框UITextField
夜冰雨
记录今天遇到的一个小需求,要在弹窗上面增加一个输入框,有两种实现方法。第一种:创建一个UIView在view上添加UITextfield和按钮第二种:利用系统的UIAlertController增加UITextfield。这里简单介绍一下第二种方法,具体代码如下:@property(nonatomic,strong)UITextField*TextField;UIAlertController*a
- 支付交易密码
33a99d830fbf
#import#import"MZTTextField.h"@interfacePasswordView:UIView//密码输入文本框@property(nonatomic,strong)MZTTextField*passwordField;@end/**设计思路:第一步:先创建控件:标题、取消按钮、一个输入框。第二步:再将输入框六等分,用分割线分开,这样看起来就有六个框了,再创建六个密码点视图
- Js函数返回值
_wy_
jsreturn
一、返回控制与函数结果,语法为:return 表达式;作用: 结束函数执行,返回调用函数,而且把表达式的值作为函数的结果 二、返回控制语法为:return;作用: 结束函数执行,返回调用函数,而且把undefined作为函数的结果 在大多数情况下,为事件处理函数返回false,可以防止默认的事件行为.例如,默认情况下点击一个<a>元素,页面会跳转到该元素href属性
- MySQL 的 char 与 varchar
bylijinnan
mysql
今天发现,create table 时,MySQL 4.1有时会把 char 自动转换成 varchar
测试举例:
CREATE TABLE `varcharLessThan4` (
`lastName` varchar(3)
) ;
mysql> desc varcharLessThan4;
+----------+---------+------+-
- Quartz——TriggerListener和JobListener
eksliang
TriggerListenerJobListenerquartz
转载请出自出处:http://eksliang.iteye.com/blog/2208624 一.概述
listener是一个监听器对象,用于监听scheduler中发生的事件,然后执行相应的操作;你可能已经猜到了,TriggerListeners接受与trigger相关的事件,JobListeners接受与jobs相关的事件。
二.JobListener监听器
j
- oracle层次查询
18289753290
oracle;层次查询;树查询
.oracle层次查询(connect by)
oracle的emp表中包含了一列mgr指出谁是雇员的经理,由于经理也是雇员,所以经理的信息也存储在emp表中。这样emp表就是一个自引用表,表中的mgr列是一个自引用列,它指向emp表中的empno列,mgr表示一个员工的管理者,
select empno,mgr,ename,sal from e
- 通过反射把map中的属性赋值到实体类bean对象中
酷的飞上天空
javaee泛型类型转换
使用过struts2后感觉最方便的就是这个框架能自动把表单的参数赋值到action里面的对象中
但现在主要使用Spring框架的MVC,虽然也有@ModelAttribute可以使用但是明显感觉不方便。
好吧,那就自己再造一个轮子吧。
原理都知道,就是利用反射进行字段的赋值,下面贴代码
主要类如下:
import java.lang.reflect.Field;
imp
- SAP HANA数据存储:传统硬盘的瓶颈问题
蓝儿唯美
HANA
SAPHANA平台有各种各样的应用场景,这也意味着客户的实施方法有许多种选择,关键是如何挑选最适合他们需求的实施方案。
在 《Implementing SAP HANA》这本书中,介绍了SAP平台在现实场景中的运作原理,并给出了实施建议和成功案例供参考。本系列文章节选自《Implementing SAP HANA》,介绍了行存储和列存储的各自特点,以及SAP HANA的数据存储方式如何提升空间压
- Java Socket 多线程实现文件传输
随便小屋
javasocket
高级操作系统作业,让用Socket实现文件传输,有些代码也是在网上找的,写的不好,如果大家能用就用上。
客户端类:
package edu.logic.client;
import java.io.BufferedInputStream;
import java.io.Buffered
- java初学者路径
aijuans
java
学习Java有没有什么捷径?要想学好Java,首先要知道Java的大致分类。自从Sun推出Java以来,就力图使之无所不包,所以Java发展到现在,按应用来分主要分为三大块:J2SE,J2ME和J2EE,这也就是Sun ONE(Open Net Environment)体系。J2SE就是Java2的标准版,主要用于桌面应用软件的编程;J2ME主要应用于嵌入是系统开发,如手机和PDA的编程;J2EE
- APP推广
aoyouzi
APP推广
一,免费篇
1,APP推荐类网站自主推荐
最美应用、酷安网、DEMO8、木蚂蚁发现频道等,如果产品独特新颖,还能获取最美应用的评测推荐。PS:推荐简单。只要产品有趣好玩,用户会自主分享传播。例如足迹APP在最美应用推荐一次,几天用户暴增将服务器击垮。
2,各大应用商店首发合作
老实盯着排期,多给应用市场官方负责人献殷勤。
3,论坛贴吧推广
百度知道,百度贴吧,猫扑论坛,天涯社区,豆瓣(
- JSP转发与重定向
百合不是茶
jspservletJava Webjsp转发
在servlet和jsp中我们经常需要请求,这时就需要用到转发和重定向;
转发包括;forward和include
例子;forwrad转发; 将请求装法给reg.html页面
关键代码;
req.getRequestDispatcher("reg.html
- web.xml之jsp-config
bijian1013
javaweb.xmlservletjsp-config
1.作用:主要用于设定JSP页面的相关配置。
2.常见定义:
<jsp-config>
<taglib>
<taglib-uri>URI(定义TLD文件的URI,JSP页面的tablib命令可以经由此URI获取到TLD文件)</tablib-uri>
<taglib-location>
TLD文件所在的位置
- JSF2.2 ViewScoped Using CDI
sunjing
CDIJSF 2.2ViewScoped
JSF 2.0 introduced annotation @ViewScoped; A bean annotated with this scope maintained its state as long as the user stays on the same view(reloads or navigation - no intervening views). One problem w
- 【分布式数据一致性二】Zookeeper数据读写一致性
bit1129
zookeeper
很多文档说Zookeeper是强一致性保证,事实不然。关于一致性模型请参考http://bit1129.iteye.com/blog/2155336
Zookeeper的数据同步协议
Zookeeper采用称为Quorum Based Protocol的数据同步协议。假如Zookeeper集群有N台Zookeeper服务器(N通常取奇数,3台能够满足数据可靠性同时
- Java开发笔记
白糖_
java开发
1、Map<key,value>的remove方法只能识别相同类型的key值
Map<Integer,String> map = new HashMap<Integer,String>();
map.put(1,"a");
map.put(2,"b");
map.put(3,"c"
- 图片黑色阴影
bozch
图片
.event{ padding:0; width:460px; min-width: 460px; border:0px solid #e4e4e4; height: 350px; min-heig
- 编程之美-饮料供货-动态规划
bylijinnan
动态规划
import java.util.Arrays;
import java.util.Random;
public class BeverageSupply {
/**
* 编程之美 饮料供货
* 设Opt(V’,i)表示从i到n-1种饮料中,总容量为V’的方案中,满意度之和的最大值。
* 那么递归式就应该是:Opt(V’,i)=max{ k * Hi+Op
- ajax大参数(大数据)提交性能分析
chenbowen00
WebAjax框架浏览器prototype
近期在项目中发现如下一个问题
项目中有个提交现场事件的功能,该功能主要是在web客户端保存现场数据(主要有截屏,终端日志等信息)然后提交到服务器上方便我们分析定位问题。客户在使用该功能的过程中反应点击提交后反应很慢,大概要等10到20秒的时间浏览器才能操作,期间页面不响应事件。
根据客户描述分析了下的代码流程,很简单,主要通过OCX控件截屏,在将前端的日志等文件使用OCX控件打包,在将之转换为
- [宇宙与天文]在太空采矿,在太空建造
comsci
我们在太空进行工业活动...但是不太可能把太空工业产品又运回到地面上进行加工,而一般是在哪里开采,就在哪里加工,太空的微重力环境,可能会使我们的工业产品的制造尺度非常巨大....
地球上制造的最大工业机器是超级油轮和航空母舰,再大些就会遇到困难了,但是在空间船坞中,制造的最大工业机器,可能就没
- ORACLE中CONSTRAINT的四对属性
daizj
oracleCONSTRAINT
ORACLE中CONSTRAINT的四对属性
summary:在data migrate时,某些表的约束总是困扰着我们,让我们的migratet举步维艰,如何利用约束本身的属性来处理这些问题呢?本文详细介绍了约束的四对属性: Deferrable/not deferrable, Deferred/immediate, enalbe/disable, validate/novalidate,以及如
- Gradle入门教程
dengkane
gradle
一、寻找gradle的历程
一开始的时候,我们只有一个工程,所有要用到的jar包都放到工程目录下面,时间长了,工程越来越大,使用到的jar包也越来越多,难以理解jar之间的依赖关系。再后来我们把旧的工程拆分到不同的工程里,靠ide来管理工程之间的依赖关系,各工程下的jar包依赖是杂乱的。一段时间后,我们发现用ide来管理项程很不方便,比如不方便脱离ide自动构建,于是我们写自己的ant脚本。再后
- C语言简单循环示例
dcj3sjt126com
c
# include <stdio.h>
int main(void)
{
int i;
int count = 0;
int sum = 0;
float avg;
for (i=1; i<=100; i++)
{
if (i%2==0)
{
count++;
sum += i;
}
}
avg
- presentModalViewController 的动画效果
dcj3sjt126com
controller
系统自带(四种效果):
presentModalViewController模态的动画效果设置:
[cpp]
view plain
copy
UIViewController *detailViewController = [[UIViewController al
- java 二分查找
shuizhaosi888
二分查找java二分查找
需求:在排好顺序的一串数字中,找到数字T
一般解法:从左到右扫描数据,其运行花费线性时间O(N)。然而这个算法并没有用到该表已经排序的事实。
/**
*
* @param array
* 顺序数组
* @param t
* 要查找对象
* @return
*/
public stati
- Spring Security(07)——缓存UserDetails
234390216
ehcache缓存Spring Security
Spring Security提供了一个实现了可以缓存UserDetails的UserDetailsService实现类,CachingUserDetailsService。该类的构造接收一个用于真正加载UserDetails的UserDetailsService实现类。当需要加载UserDetails时,其首先会从缓存中获取,如果缓存中没
- Dozer 深层次复制
jayluns
VOmavenpo
最近在做项目上遇到了一些小问题,因为架构在做设计的时候web前段展示用到了vo层,而在后台进行与数据库层操作的时候用到的是Po层。这样在业务层返回vo到控制层,每一次都需要从po-->转化到vo层,用到BeanUtils.copyProperties(source, target)只能复制简单的属性,因为实体类都配置了hibernate那些关联关系,所以它满足不了现在的需求,但后发现还有个很
- CSS规范整理(摘自懒人图库)
a409435341
htmlUIcss浏览器
刚没事闲着在网上瞎逛,找了一篇CSS规范整理,粗略看了一下后还蛮有一定的道理,并自问是否有这样的规范,这也是初入前端开发的人一个很好的规范吧。
一、文件规范
1、文件均归档至约定的目录中。
具体要求通过豆瓣的CSS规范进行讲解:
所有的CSS分为两大类:通用类和业务类。通用的CSS文件,放在如下目录中:
基本样式库 /css/core
- C++动态链接库创建与使用
你不认识的休道人
C++dll
一、创建动态链接库
1.新建工程test中选择”MFC [dll]”dll类型选择第二项"Regular DLL With MFC shared linked",完成
2.在test.h中添加
extern “C” 返回类型 _declspec(dllexport)函数名(参数列表);
3.在test.cpp中最后写
extern “C” 返回类型 _decls
- Android代码混淆之ProGuard
rensanning
ProGuard
Android应用的Java代码,通过反编译apk文件(dex2jar、apktool)很容易得到源代码,所以在release版本的apk中一定要混淆一下一些关键的Java源码。
ProGuard是一个开源的Java代码混淆器(obfuscation)。ADT r8开始它被默认集成到了Android SDK中。
官网:
http://proguard.sourceforge.net/
- 程序员在编程中遇到的奇葩弱智问题
tomcat_oracle
jquery编程ide
现在收集一下:
排名不分先后,按照发言顺序来的。
1、Jquery插件一个通用函数一直报错,尤其是很明显是存在的函数,很有可能就是你没有引入jquery。。。或者版本不对
2、调试半天没变化:不在同一个文件中调试。这个很可怕,我们很多时候会备份好几个项目,改完发现改错了。有个群友说的好: 在汤匙
- 解决maven-dependency-plugin (goals "copy-dependencies","unpack") is not supported
xp9802
dependency
解决办法:在plugins之前添加如下pluginManagement,二者前后顺序如下:
[html]
view plain
copy
<build>
<pluginManagement