这个“弹出窗口”怎么样?视图已创建?

发布于 2024-12-12 22:06:59 字数 127 浏览 5 评论 0 原文

请看下图。

这个“弹出”视图是如何创建的?假设我想用字体完全模仿那个视图,我该怎么做?

在此处输入图像描述

Please see the image below.

How was this 'pop-up' view created? Suppose I wanted to completely imitate that view with the fonts, how would I do so?

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

殊姿 2024-12-19 22:07:04

金字塔形状与单击以显示弹出窗口的按钮无关。它将是弹出视图的子视图,要么是 UIImageView,要么可能绘制在 UIView 上,尽管 UIImageView 是更简单的解决方案。您绝对可以对弹出视图进行编码,以将该箭头指向屏幕上的任何点或任何方向。我要做的是通过名为 initFromPoint: 的 init 方法实例化弹出窗口,然后传递用于启动弹出窗口的按钮的中心值。然后在弹出窗口的 viewDidLoad 方法中根据该点适当地放置该点。

The pyramid shape is not associated with the button that was clicked to present the popup. It would be a subview of the popup view, either a UIImageView or possibly drawn on a UIView, although a UIImageView would be the easier solution. You could definitely code the popup view to point that arrow at any point on the screen or in any direction. What I would do is instantiate the popup by means of an init method called initFromPoint:, then pass the center value of the button used to launch the popup. Then within the viewDidLoad method of the popup place the point appropriately based on the point.

满意归宿 2024-12-19 22:07:03

没有为此公开的 SDK 组件,但是可以使用视图层次结构轻松实现:

UIView - 主视图。使用贝塞尔曲线路径创建突出部分
从源头说起。添加了边框和阴影
层。

UIButton - 较小的字体
UIButton - 更大的字体
UIButton - 更改字体类型
UIButton - 棕褐色容器。
UILabel - “棕褐色”文本
UISwitch - 打开和关闭棕褐色

只需用动画显示和隐藏视图。另外,创建委托回调以告知委托弹出窗口中发生事件的时间。

// Delegate returns if the text can get smaller to enable/disable the button
- (BOOL) didSelectSmallerFont:(CGFloat)fontSize;
// Delegate returns if the text can get larger to enable/disable the button
- (BOOL) didSelectLargerFont:(CGFloat)fontSize; 
- (void) didChangeFont:(UIFont*)font;
- (void) didToggleSepia:(BOOL)enabled;

ETC。

There is not a SDK exposed component for this, but this could very easily be made using a hierarchy of views:

UIView - Main view. Uses a bezier path to create a protrusion to
point from the source. Has a border and drop shadow added to its
layer.

UIButton - Smaller font
UIButton - Larger font
UIButton - Change font type
UIButton - Container for sepia.
UILabel - "Sepia" text
UISwitch - turning sepia on and off

Just show and hide the view with an animation. Also, create delegate callbacks to tell the delegate when events occur in the popover.

// Delegate returns if the text can get smaller to enable/disable the button
- (BOOL) didSelectSmallerFont:(CGFloat)fontSize;
// Delegate returns if the text can get larger to enable/disable the button
- (BOOL) didSelectLargerFont:(CGFloat)fontSize; 
- (void) didChangeFont:(UIFont*)font;
- (void) didToggleSepia:(BOOL)enabled;

etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文