How can I change the label “Cancel” from modal segue in Apple Watch

后端 未结 4 1797
无人及你
无人及你 2021-01-04 01:38

How to change the label appearing at the top left corner that says \"Cancel\" when I open a modal view... I would like it to be a button with an image.

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-04 01:57

    I looked at the "Presenting Interface Controllers Modally" section of the WatchKit programming guide, which said:

    The top-left corner of a modal interface displays the interface controller’s title string. When the user taps that string, WatchKit dismisses the modal interface. Set the title string to reflect the meaning of dismissing the modal interface. For example, when displaying information, you might set the string to Done or Close. If you do not specify a title for your interface controller, WatchKit displays the string Cancel by default.

    And about that "Cancel" bit, the WKInterfaceController documentation for presentControllerWithName:context::

    The title of the modal interface is set to the string Cancel unless the presented interface controller explicitly changes it using the setTitle: method.

    seems to indicate your only choice at this time is another string, not an image.

提交回复
热议问题