请参见下图。
这个“弹出” View 是如何创建的?假设我想用字体完全模仿该 View ,我该怎么做?
最佳答案
没有为此公开的 SDK 组件,但是可以使用 View 层次结构轻松实现:
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
只需用动画显示和隐藏 View 。另外,创建委托(delegate)回调以告知委托(delegate)弹出窗口中发生事件的时间。
// 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;
等等
关于iphone - 这个 'pop-up' View 是如何创建的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7930599/