简体   繁体   English

突出显示 MFMessageComposeViewController 中的 SEND 按钮

[英]Highlighting the SEND button in MFMessageComposeViewController

I have generated an MFMessageComposeViewController to send a preconfigured SMS message, and I now want to draw the user's attention to the send button.我已经生成了一个MFMessageComposeViewController来发送预配置的 SMS 消息,现在我想将用户的注意力吸引到发送按钮上。 The user has already initiated the "send message" process from within the app, but they must then press the send button within the MFMessageComposeViewController to actually send the message.用户已经从应用程序中启动了“发送消息”过程,但他们必须随后按下MFMessageComposeViewController中的发送按钮才能真正发送消息。 The send button in the standard MFMessageComposeViewController is "hidden away" in the bottom corner of the message body where some, not so tech-savvy users, struggle to find it (a fact not opinion, as I have had test users ask what to do next)!标准MFMessageComposeViewController中的发送按钮“隐藏”在消息正文的底部角落,一些不太精通技术的用户很难找到它(事实不是意见,因为我有测试用户询问该怎么做下一个)!

Apple does not allow this message compose interface to be modified, except for certain exceptions.除某些例外情况外,Apple 不允许修改此消息撰写界面。 I have looked into the UIAppearance protocol, which provides limited options to modify aspects of the MFMessageComposeViewController , but the options do not apply to the send button.我查看了UIAppearance协议,它提供了有限的选项来修改MFMessageComposeViewController的各个方面,但这些选项不适用于发送按钮。

I have looked into the documentation, and there are options to highlight or focus on interface objects using the accessibility options, but I can not find a way of linking this to the send button within the MFMessageComposeViewController where I have limited access to the UI components.我查看了文档,有一些选项可以使用可访问性选项突出显示或关注界面对象,但我找不到将其链接到MFMessageComposeViewController中的发送按钮的方法,我对 UI 组件的访问权限有限。

How do I highlight the send button within the MFMessageComposeViewController , or access the button so that I can draw the user's attention to it?如何突出显示MFMessageComposeViewController中的发送按钮,或访问该按钮以便吸引用户注意它?

It's not possible to directly highlight or focus on the send button within the MFMessageComposeViewController using the public API. The only options you have for modifying the appearance of the MFMessageComposeViewController are through the UIAppearance protocol, which does not allow you to modify the send button.使用公共 API 无法直接突出显示或关注MFMessageComposeViewController中的发送按钮。修改MFMessageComposeViewController外观的唯一选项是通过 UIAppearance 协议,该协议不允许您修改发送按钮。

One possible workaround could be to add a custom overlay view on top of the MFMessageComposeViewController that includes a highlighted or larger version of the send button, or some other visual indicator that draws the user's attention to the location of the send button.一种可能的解决方法是在MFMessageComposeViewController顶部添加自定义覆盖视图,其中包括突出显示或更大版本的发送按钮,或其他一些视觉指示器,以吸引用户注意发送按钮的位置。 You could also consider adding a brief instructional message or label above the send button to help guide the user.您还可以考虑在发送按钮上方添加简短的说明消息或 label 以帮助指导用户。

Alternatively, you could consider using a custom view controller or interface for sending SMS messages, rather than using the system-provided MFMessageComposeViewController .或者,您可以考虑使用自定义视图 controller 或用于发送 SMS 消息的界面,而不是使用系统提供的MFMessageComposeViewController This would give you more control over the layout and appearance of the interface and allow you to highlight or focus on the send button as needed.这会让您更好地控制界面的布局和外观,并允许您根据需要突出显示或关注发送按钮。 Keep in mind that if you choose this approach, you will need to handle the SMS sending functionality yourself.请记住,如果您选择这种方法,您将需要自己处理 SMS 发送功能。

Unfortunately, it is not possible to directly highlight or modify the appearance of the send button within the standard MFMessageComposeViewController.遗憾的是,无法在标准 MFMessageComposeViewController 中直接突出显示或修改发送按钮的外观。 This is because the interface provided by the MFMessageComposeViewController is not directly customizable and is intended to provide a consistent user experience across all iOS apps.这是因为 MFMessageComposeViewController 提供的界面不可直接自定义,旨在为所有 iOS 应用程序提供一致的用户体验。

One solution to consider is to provide additional instructions or guidance to the user before they are presented with the MFMessageComposeViewController.要考虑的一种解决方案是在向用户展示 MFMessageComposeViewController 之前向他们提供额外的说明或指导。 This could include an on-screen message or tutorial that specifically points out the location of the send button within the interface, or providing a visual indicator such as an arrow or highlight box to guide the user to the correct location.这可能包括屏幕上的消息或教程,专门指出界面中发送按钮的位置,或提供视觉指示器(例如箭头或突出显示框)以引导用户到正确的位置。

Another option is to present the MFMessageComposeViewController in a modal view controller and add additional instructions or guidance in the modal view controller.另一种选择是在模态视图 controller 中呈现 MFMessageComposeViewController,并在模态视图 controller 中添加其他说明或指南。

Also, you can use the accessibility options to add a VoiceOver label to the button, which can be read out loud to the user when the button is in focus.此外,您可以使用辅助功能选项将 VoiceOver label 添加到按钮,当按钮处于焦点时可以大声读出给用户。

It's worth noting that Apple's HIG (Human Interface Guidelines) discourages from customizing the system's standard view controller. You should try to stick to the standard iOS interface so that the user can feel comfortable and familiar with the app.值得注意的是,Apple 的 HIG(Human Interface Guidelines)不鼓励自定义系统的标准视图 controller。您应该尽量坚持标准的 iOS 界面,这样用户才能感到舒适和熟悉该应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM