iphone - 这个 'pop-up' View 是如何创建的?

标签 iphone view ibooks

请参见下图。

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

enter image description here

最佳答案

没有为此公开的 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/

相关文章:

javascript - 如何使用javascript淡化图像?

iphone - UITextView 对齐方式正在自行更改

iphone - 从服务器加载 "weird characters"的标签

iphone - 在这段短代码中找不到内存泄漏的位置

css - 为 iAd Producer 对象添加自定义 CSS

android - 如何要求具有指定 ID 的 View

android - 电话拨号器中的字母标签是什么意思?

android: 一个新的 GUI 问题 - 如何在没有布局 XML 文件的情况下声明 viewGroup?

ios - 更新使用 iBooks Author 创建的图书