OGeek|极客世界-中国程序员成长平台

标题: ios - 使用 UIWebView 和/或 UITableView 创建下拉效果 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 16:09
标题: ios - 使用 UIWebView 和/或 UITableView 创建下拉效果

在 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/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4