【发布时间】:2014-03-10 13:18:55
【问题描述】:
我看到iOS floating button over table view 关于如何创建浮动按钮。这就是我创建按钮的方式。问题是按钮会随着表格视图滚动。
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self
action:@selector(aMethod:)
forControlEvents:UIControlEventTouchDown];
[button setTitle:@"Show View" forState:UIControlStateNormal];
button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0);
[view addSubview:button];
我该如何解决这个问题?
我建议你使用https://github.com/gizmoboy7/VCFloatingActionButton这个链接....希望它对你有用
【问题讨论】:
-
您是否对
UIViewController或UITableViewController进行了子类化? -
最简单的方法是使用 MEVFloatingButton 库。更多信息github.com/manuelescrig/MEVFloatingButton
标签: ios objective-c uitableview cocoa-touch layout