我正在尝试复制滑动以删除函数,就像在mailviewview中一样.只有这次我需要在收集视图上构建它,但我有点困难.这是一个水平滚动列表,向上滑动即可删除.我已经完成了向上滑动,但很难搞清楚我需要如何设置滑动以删除/点按以删除或忽略功能.
所以我使用以下collectionview:
func buildCollectionView() {
let layout: UICollectionViewFlowLayout = UICollectionViewFlowLayout()
layout.scrollDirection = .horizontal
layout.minimumInteritemSpacing = 0;
layout.minimumLineSpacing = 4;
collectionView = UICollectionView(frame: CGRect(x: 0, y: screenSize.midY - 120, width: screenSize.width, height: 180), collectionViewLayout: layout)
collectionView.dataSource = self
collectionView.delegate = self
collectionView.register(VideoCell.self, forCellWithReuseIdentifier: "videoCell")
collectionView.showsHorizontalScrollIndicator = false
collectionView.showsVerticalScrollIndicator = false
collectionView.contentInset = UIEdgeInsetsMake(0, 20, 0, 30)
collectionView.backgroundColor = UIColor.white()
collectionView.alpha = 0.0
//can swipe cells outside collectionview region
collectionView.layer.masksToBounds = false
swipeUpRecognizer = UIPanGestureRecognizer(target: self, action: #selector(self.deleteCell))
swipeUpRecognizer.delegate = self …
Run Code Online (Sandbox Code Playgroud) 我使用以下代码将NSTextField子类化:
import Cocoa
class CustomSearchField: NSTextField {
override func draw(_ dirtyRect: NSRect) {
self.wantsLayer = true
let textFieldLayer = CALayer()
self.layer = textFieldLayer
self.backgroundColor = NSColor.white
self.layer?.backgroundColor = CGColor.white
self.layer?.borderColor = CGColor.white
self.layer?.borderWidth = 0
super.cell?.draw(withFrame: dirtyRect, in: self)
}
}
class CustomSearchFieldCell: NSTextFieldCell {
override func drawingRect(forBounds rect: NSRect) -> NSRect {
let minimumHeight = self.cellSize(forBounds: rect).height
let newRect = NSRect(x: rect.origin.x + 25, y: (rect.origin.y + (rect.height - minimumHeight) / 2) - 4, width: rect.size.width - 50, height: …
Run Code Online (Sandbox Code Playgroud) 我正在构建一个需要具有以下输出的砌体网格:
但问题是砌体是先填充水平空间,然后填充垂直间距.所以第一部分是砌砖,但第二部分不是.
项目4和项目5将彼此相邻放置,项目6将设置在它下面.
我的容器的宽度需要是100%,物品需要是流动的.所以我使用百分比网格.我不能坚持一个固定的!
我已经尝试过以下方法:
http://output.jsbin.com/zojivodosu
正如你在jsbin中看到的那样,问题仍然存在.无论如何我可以填写垂直空间并在那个水平空间之后?
如果可能的话,我不想自定义我的HTML.提前致谢.
亲切的问候,
沃特
我正在设置我的webpack并且它运行良好,但在开发中它正在为我编译的scss样式表提供内联而不是使用URL.
module: {
rules: [
{
test: /\.scss$/,
use: [
{ loader: "style-loader"},
{ loader: "css-loader" },
{ loader: 'postcss-loader',
options: {
plugins: () => [require('autoprefixer')]
}
},
{ loader: "sass-loader" }
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
所以我抓住了文档并阅读了如何使用单个CSS
文件.我将我的webpack配置更新为以下内容,因为所有加载器都以相反的顺序运行,这应该可以正常工作;
module: {
rules: [
{
test: /\.scss$/,
use: [
{ loader: "style-loader/url"},
{ loader: "file-loader" },
{ loader: "css-loader" },
{ loader: 'postcss-loader',
options: {
plugins: () => [require('autoprefixer')]
}
},
{ loader: "sass-loader" }
]
}
]
} …
Run Code Online (Sandbox Code Playgroud) 我有一个小node.js和socket.io项目,我想在我的服务器上在线运行.我使用jade作为我的文件,并使用npm install将其打包完成.所以一切都在我的本地文件夹中.我也可以在本地运行它.
但我想连接我的手机来控制我的浏览器,我无法将手机连接到本地主机.所以我需要在线运行它.
问题是,当我把它放在网上时,我有一个index.jade文件.这个浏览器不会将其识别为网页.所以当我去http://www.woutervdkamp.nl/iphoneconnect/views时,我只得到一个禁止的页面
我的文件夹结构如下:
??? httpdocs
??? iphoneconnect
| ??? node-modules
| ??? express
| ??? jade
| ??? socket.io
??? package.json
??? server.js
??? views
??? index.jade
??? mobile.jade
Run Code Online (Sandbox Code Playgroud)
我需要使用特殊主机吗?或者有人能指出我正确的方向!提前致谢.
我正试图做这样的事情:http: //sportyfinger.lecoqsportif.com/uk-en/connexion
如果有人得到一个很好的教程,那就太好了!我只想知道如何建立iphone和webbrowser之间的连接!已经有了一些东西,但它有点慢.
映入眼帘,
沃特