- 浏览: 393672 次
- 性别:
- 来自: 上海
最新评论
-
wu1238:
2c2ab98030fc767cf89051f369a97c5 ...
Swift -> UILable 设置内边距 UIEdgeInsets , UITextField 设置内边距
文章列表
设置 uiimageView 的 颜色 tinyColor
let imgV:UIImageView = UIImageView();
imgV.image = #imageLiteral(resourceName: "image_resource")
imgV.image = arrow_rt.image?.withRenderingMode(.alwaysTemplate)
imgV.tintColor = UIColor.blue
swift -> 蓝牙
- 博客分类:
- swift
来源 : http://www.jianshu.com/p/38a4c6451d93
** 扫描 外设 或 连接 , 具体 DEMO 看 附件 。
//
// ViewController.swift
// 蓝牙中心设备Swift
//
// Created by 吴浩 on 2018/1/12.
// Copyright © 2018年 wuhao. All rights reserved.
//
import UIKit
import CoreBluetooth
class ViewController: UIViewController ...
swift -> 二维码扫描
- 博客分类:
- swift
import UIKit
import AVFoundation
class ScannerViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate,
UIAlertViewDelegate{
var scanRectView:UIView!
var device:AVCaptureDevice!
var input:AVCaptureDeviceInput!
var output:AVCaptureMetadataOutput!
...
常用代码 -> Web前端
- 博客分类:
- 常用代码
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1, user-scalable=0" />
<link type="text/css ...
swift -> 问题总结 FAQ
- 博客分类:
- swift
*** dismiss 后不执行 deinit 原因 分析,如果不执行 会导致 内存得不到释放,
1, 本类self 是否 有传入到 其他 类中 。
2, xx.delegate 代理需要在 dismiss 前 = nil
** 代码 控制 IPAD 横竖屏 不起效 , 勾选个 Requires full screen
随笔 -> 网址收藏
- 博客分类:
- 随笔
WKWebView-插入本地图片到html
https://blog.csdn.net/longshihua/article/details/78008594
import UIKit
var itemWh:CGFloat = 0,itemHt:CGFloat = 75;
class ViewController:UIViewController,UICollectionViewDelegate,UICollectionViewDataSource{
var data:[String] = [String]();
let cellName:String = "MyCell";
var myCollection : UICollectionView!
...
* 结果显示如下
RootTabBar.swift
import UIKit
let screenHt:CGFloat = UIScreen.main.bounds.height;
let screenWh:CGFloat = UIScreen.main.bounds.width;
class RootTabBar: UITabBarController{
override func viewDidLoad() {
super.viewDidLoad()
//
let nav ...
自定义一个 图文排列的 UIBUTTON
自定义一个UIControl 然后添加UILabel 和 UIImageView 以及添加 addTarget 的 各种 touchEvent 事件
let re:UIControl = UIControl()
let re:UIControl = UIControl()
let imgV = UIImageView(frame: CGRect(x: 0, y: 0, width: deskBtnWh, height: deskBtnWh))
imgV.image ...
UILabel
class UILabel_2:UILabel{
open var insetEdge:UIEdgeInsets!;
override func drawText(in rect: CGRect) {
super.drawText(in: UIEdgeInsetsInsetRect(rect, insetEdge))
}
}
swift 4.0 更新
class UILabel_2: UILabel {
open var insetEdge:UIEdgeInsets!;
...
更多参考 :
https://blog.csdn.net/EIamor/article/details/78293439
** tapges 与 uibutton 冲突, 如果是button 就不执行 tapges
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
if((touch.view)?.isKind(of: UIButton.self))!{
...
* 在 某一个方法执行完成后 执行 某个方法 或者 一系列操作
func closeThis2(callBack: @escaping () -> Swift.Void){
UIView.animate(withDuration: 1.25, animations: {() -> Void in
//一些动画
}){(finished) -> Void in
callBack()
}
}
//调用
closeThis2(callBack: { ...
来源 : http://ons.me/484.html
功能:
支持img标签图片懒加载、div标签(或者其他标签)的背景图片懒加载;
支持预加载。默认是图片出现在屏幕时开始加载,可以设置threshold参数,如threshold:100,此时图片出现在屏幕之前100px时开始加载;
背景图片懒加载时,自动添加base64的1*1透明图片做默认背景图。也可以自定义默认背景图,参数为placeholder。
使用方法:
引用1.1.3的Zepto(我只测过这个目前最新版),并引用picLazyLoad.js。→picLazyLoad.js← →
zepto -> 实现滑动翻页
- 博客分类:
- zepto
zepto 官网: http://www.zeptojs.cn/#download
全部代码 包括了 各种 插件
https://github.com/madrobby/zepto
其中 fx.js 是 animate 动画插件 必须
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial ...
ios -> 苹果审核 crash log 分析
- 博客分类:
- IOS
来自 : http://www.cnblogs.com/siasyl/p/7339013.html
参考文章:http://www.qingpingshan.com/rjbc/ios/230949.html
1.桌面新建一个文件夹,自行命名(crash);
2.找到Xcode的位置,右键"显示包内容",根据以下目录找到symbolicatecrash工具:
/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/sym ...