• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ios - 使用 UIWebView 和/或 UITableView 创建下拉效果

[复制链接]
菜鸟教程小白 发表于 2022-12-12 16:09:32 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

在 Wikipedia 的移动应用程序中,它们具有下拉效果,如果您单击该行,它会打开该行的内容并将其插入到页面中。例如,行可能是职业、商业生活和个人生活,如果单击职业行,它会在职业和商业生活行之间插入职业内容。如果您再次单击“职业”行,则“职业”内容会消失,您将回到仅一行。我希望我的内容采用 HTML 格式,所以我假设我需要以某种方式使用 UIWebView 执行此操作,可能与 UITableView 结合使用。我该如何创造这样的效果?



Best Answer-推荐答案


你为什么不使用 UIActionSheet....尝试类似...

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil
                                                      delegate:self
                                             cancelButtonTitle"Cancel"
                                        destructiveButtonTitle:nil
                                             otherButtonTitles"Take photo",@"Choose existing", nil];



            actionSheet.actionSheetStyle=UIActionSheetStyleBlackTranslucent;

           [actionSheet showFromRect:[sender frame] inView:self.view animated:YES]; //sender is the cell

也在委托(delegate)方法中实现 Action .....

-(void)actionSheetUIActionSheet *)actionSheet clickedButtonAtIndexNSInteger)buttonIndex
{



    if(buttonIndex==0)
    {
    // blah blah
    }
else if(buttonIndex==1)
    {
    //sec index action... 
    }
}

你会得到类似...... enter image description here

关于ios - 使用 UIWebView 和/或 UITableView 创建下拉效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19805752/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap