在维基百科的移动应用程序中,它们具有下拉效果,如果您单击该行,它会打开该行的内容并将其插入到页面中。例如,行可能是“职业”、“商业生活”和“个人生活”,如果您单击“职业”行,它会在“职业”和“商业生活”行之间插入职业内容。如果您再次单击 Career 行,Career 内容将消失,您将返回到只有一行。我希望我的内容采用 HTML 格式,所以我假设我需要以某种方式使用 UIWebView 执行此操作,可能与 UITableView 结合使用。我将如何创建这样的效果?
最佳答案
你为什么不使用 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)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(buttonIndex==0)
{
// blah blah
}
else if(buttonIndex==1)
{
//sec index action...
}
}
你会得到类似......
关于ios - 使用 UIWebView 和/或 UITableView 创建下拉效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19805752/