小编Swi*_*att的帖子

使用应用程序作为变量激活Applescript中的应用程序

我正在尝试编写一个记录当前应用程序的脚本,切换到另一个应用程序,执行某项任务,然后返回到原始应用程序.这就是我所拥有的

set currentApp to my getCurrentApp()
activate application "Safari"
# Some task
activate application currentApp

to getCurrentApp()
set front_app to (path to frontmost application as Unicode text)
set AppleScript's text item delimiters to ":"
set front_app to front_app's text items
set AppleScript's text item delimiters to {""} --> restore delimiters to default value
set item_num to (count of front_app) - 1
set app_name to item item_num of front_app
set AppleScript's text item delimiters to "."
set app_name to app_name's text …
Run Code Online (Sandbox Code Playgroud)

applescript

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

UISearchBar范围栏背景图像可设置,但不是颜色?

    for subView in searchBar.subviews {
        if let scopeBar = subView as? UISegmentedControl {
            scopeBar.backgroundColor = UIColor.blueColor()
        }
    }
Run Code Online (Sandbox Code Playgroud)

我一直在尝试上面的代码来尝试获得对scopeBar的引用,并随后设置其背景色,但是我无法获得引用。它似乎只循环一次,这意味着搜索栏只有一个子视图。在调试器中,搜索栏似乎具有一个名为_scopeBar的实例变量,其类型为(UISegmentedControl *)。

    if let topView = searchBar.subviews.first {
        for subView in topView.subviews {
            if let cancelButton = subView as? UIButton {
                cancelButton.tintColor = UIColor.whiteColor()
                cancelButton.enabled = true
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

第二段代码用于访问搜索栏的cancelButton。

uisearchbar ios swift

3
推荐指数
1
解决办法
1544
查看次数

弹出时视图控制器中的 UIView 滞后

当我从导航堆栈中弹出视图控制器时,弹出的导航控制器中的蓝色视图在离开屏幕时会出现延迟,并拖尾在视图控制器的其余部分后面,如视频所示:https : //vid.me /GbBG

这是什么原因,如何解决?

uiview uinavigationcontroller ios swift

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