小编gur*_*eep的帖子

使用动画同时显示2个视图控制器

我正在关注这个非常棒的视频,为我的项目创建一个自定义过渡,因为我正在为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)

animation ios swift

10
推荐指数
2
解决办法
462
查看次数

如何在Swift中以编程方式设置UITableView单元格高度

如何以编程方式设置视图高度我已经尝试此代码

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)

uitableview ios swift

8
推荐指数
4
解决办法
2万
查看次数

无法在真实设备上运行自动化脚本

我是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)

eclipse safari android ipad appium

6
推荐指数
1
解决办法
230
查看次数

在现有NSMutableAttributed字符串中添加属性

我正在研究一些属性字符串格式.我需要在现有的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)

objective-c nsattributedstring strikethrough ios

0
推荐指数
1
解决办法
1607
查看次数