我正在关注这个非常棒的视频,为我的项目创建一个自定义过渡,因为我正在为iPad开发,所以我不想将目标视图控制器全屏显示,而是让它占据屏幕的一半,如下所示:
我的自定义转换类的代码是:
class CircularTransition: NSObject {
var circle = UIView()
var startingPoint = CGPoint.zero {
didSet {
circle.center = startingPoint
}
}
var circleColor = UIColor.white
var duration = 0.4
enum circularTransitionMode: Int {
case present, dismiss
}
var transitionMode = circularTransitionMode.present
}
extension CircularTransition: UIViewControllerAnimatedTransitioning {
func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
return duration
}
func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
let containerView = transitionContext.containerView
if transitionMode == .present {
if let presentedView = transitionContext.view(forKey: UITransitionContextViewKey.to) { …Run Code Online (Sandbox Code Playgroud) 如何以编程方式设置视图高度我已经尝试此代码
cell.viewMain.frame = CGRectMake(cell.viewMain.frame.origin.x, cell.viewMain.frame.origin.y, cell.viewMain.frame.size.width, 65.0)
Run Code Online (Sandbox Code Playgroud)
但这不起作用.
更新:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("updateCell", forIndexPath: indexPath) as! UpdateCell
if self.data[indexPath.row] == "b" {
tbUpdate.rowHeight = 85
cell.viewMain.frame = CGRectMake(cell.viewMain.frame.origin.x, cell.viewMain.frame.origin.y, cell.viewMain.frame.size.width, 65.0)
}else{
tbUpdate.rowHeight = 220
cell.viewMain.frame = CGRectMake(cell.viewMain.frame.origin.x, cell.viewMain.frame.origin.y, cell.viewMain.frame.size.width, 200.0)
}
return cell
}
Run Code Online (Sandbox Code Playgroud) 我是appium和eclipse的新手,我正试图在设备上运行简单的脚本.我添加了UDID并创建了配置文件.几天前,脚本运行正常,但今天我的iPad上的safari启动器应用程序突然崩溃了.当我重新安装safari启动器时,当我尝试运行脚本时得到下面列出的错误,是否有人遇到过类似的问题?
2016-09-16 11:57:44:131 - [debug] [Instruments] Attempting to launch instruments, this is try #1
2016-09-16 11:57:44:131 - [Instruments] Launching instruments
2016-09-16 11:57:44:135 - [debug] [Instruments] Attempting to run app on real device with UDID 'd83c88477a911a053e5de26036fe8b0512e3d0e6'
2016-09-16 11:57:44:137 - [debug] [Instruments] Found Insruments-Without-Delay: /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-instruments/thirdparty/iwd7
2016-09-16 11:57:44:138 - [debug] [Instruments] Spawning instruments with command: '"/Applications/Xcode 4.app/Contents/Developer/usr/bin/instruments" -t "/Applications/Xcode 4.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate" -D /var/folders/py/kgvfbnsd4dl8xvx3nktsh6p00000gn/T/appium-instruments/instrumentscli0.trace -w d83c88477a911a053e5de26036fe8b0512e3d0e6 com.bytearc.SafariLauncher -e UIASCRIPT "/Users/vbs/Library/Application Support/appium/bootstrap/bootstrap-bcf5a832c5089d74.js" -e UIARESULTSPATH /var/folders/py/kgvfbnsd4dl8xvx3nktsh6p00000gn/T/appium-instruments'
2016-09-16 11:57:44:138 - [debug] [Instruments] And extra without-delay env: {}
2016-09-16 …Run Code Online (Sandbox Code Playgroud) 我正在研究一些属性字符串格式.我需要在现有的NSMutableAttributed字符串中添加删除线.在下面给出的例子中是否可能.
First Task For Bhasin
30 Jun 2017 12:05 PM till 30 Jun 2017 01:05 PM{
NSBackgroundColor = "<CGColor 0x6100000934c0> [<CGColorSpace 0x6080000303c0> (kCGColorSpaceICCBased; kCGColorSpaceModelMonochrome; Generic Gray Gamma 2.2 Profile; extended range)] ( 0 0 )";
NSColor = "<CGColor 0x6180002a2ac0> [<CGColorSpace 0x610000230920> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; sRGB IEC61966-2.1; extended range)] ( 1 0 0 1 )";
NSFont = "<UICTFont: 0x7fac5476a0b0> font-family: \"Helvetica\"; font-weight: normal; font-style: normal; font-size: 15.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 0, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent …Run Code Online (Sandbox Code Playgroud) ios ×3
swift ×2
android ×1
animation ×1
appium ×1
eclipse ×1
ipad ×1
objective-c ×1
safari ×1
uitableview ×1