问题标签 [wkinterfacebutton]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
173 浏览

objective-c - WKInterfaceButton 响应时间

My Watch 应用程序包含一个从WKInterfaceButtons. 非常基本,每个按钮都代表数字(0-9)并且有一个IBAction更新一个WKInterfaceLabelIBActions不包含任何繁重的工作(没有 Web 服务调用或核心数据更新),只需将所选数字连接到已输入的数字并更新标签的文本。

现在,如果我快速按下同一个按钮两次或更多次,那么有时该按钮不会响应下一次按下(感觉触摸仍然处于活动状态并且按钮还没有响应)。我知道与 Watch 的任何交互都需要 Watch 和 iPhone 之间的往返通信,但它的运行速度仍然比我见过的其他实现类似数字键盘的 Watch 应用程序慢得多。有什么想法可以改善按钮的响应时间吗?

0 投票
1 回答
2023 浏览

ios - Change WKInterfaceButton background image on tap

I'm trying to change the background image of a WKInterfaceButton in my storyboard when a tap occurs. Also, on calling the setBackgroundImage to change the image, appendValue(1) does not work.

0 投票
1 回答
1647 浏览

ios - 单击时更改按钮背景颜色-WatchKit

按钮背景最初是没有背景的白色。需要将背景更改为以下十六进制值:#cd9037

任何机构都建议为什么以下不起作用?仔细检查 RGI 值。

0 投票
1 回答
347 浏览

ios - Apple Watch 应用中的按钮可以包含组吗?

我正在尝试在 Apple Watch 上的按钮内设置图像(不是背景图像)。有没有办法可以将组放在按钮中?我知道我们可以反过来做。

0 投票
1 回答
281 浏览

watchkit - 检测 WKInterfaceButton 连续按下?

WatchKit 就在这里,它为程序员提供了非常有限的代码。

我的问题:

如何检测用户是否连续按下 WKInterfaceButton?

  • Selector ... forControlEvents .. 不受支持。
  • 不支持触摸开始...。

谢谢你的时间!

此致,

0 投票
2 回答
779 浏览

ios - WKInterfaceButton 多行标题

如何在 WKInterfaceButton 中显示三到四行标题?我尝试将大小设置为适合内容,但标题最多只显示两行。

0 投票
2 回答
822 浏览

apple-watch - watchOS 2 是否有用于 Force Touch 的 API?

作为标题,比如说我想确定WKInterfaceButton是正常点击还是通过强制触摸。现在可以通过 watchOS 2 实现吗?

0 投票
1 回答
521 浏览

watchkit - 如何在 watchkit 中隐藏 WKInterfaceButton

有谁知道我如何以编程方式在 watchkit 中隐藏 WKInterfaceButton?

似乎没有像 uibutton 这样的 setHidden 界面。

0 投票
1 回答
213 浏览

ios - 如何使用 iOS WatchKit 将 WKInterfaceButton 的标题文本居中

我试过这个:

我得到错误:

在 wkinterfacebutton 类型的对象上找不到属性标题标签

我怎样才能做到这一点?

0 投票
1 回答
423 浏览

watchkit - 在 watchOS 2 中使 WKInterfaceButton 按键更清晰

我发现在 watchOS2 中按下按钮(WKInterfaceButton)时的图形反馈非常弱。很难看到,甚至 Apple 似乎也认为是这种情况,因为他们在解锁屏幕中将活动按钮的背景更改为白色。默认行为是使整个按钮变暗。

如何在 watchOS 2 中清除按钮按下?例如,我可以更改活动上的按钮文本颜色,但是当它不再处于活动状态时如何轻松将其更改回来?