0
我試試這個示例 http://b2cloud.com.au/tutorial/reordering-a-uitableviewcell-from-any-touch-point/ 但是在xamarin上這個不行! 這是我的代碼從任何接觸點重新排序UITableViewCell(Xamarin)
public override void WillDisplay (UITableView tableView, UITableViewCell cell, NSIndexPath indexPath)
{
if(item.Description.Contains("UITableViewCellReorderControl"))
{
UIView resizedGripView = new UIView(new CGRect(0,0,item.Frame.X,item.Bounds.Height));
resizedGripView.AddSubview(item);
cell.AddSubview(resizedGripView);
CGSize sizeDifference = new CGSize(resizedGripView.Frame.Size.Width - item.Frame.Size.Width,
resizedGripView.Frame.Size.Height - item.Frame.Size.Height);
CGSize transformRatio = new CGSize(resizedGripView.Frame.Size.Width/item.Frame.Size.Width,
item.Frame.Size.Height/item.Frame.Size.Height);
CGAffineTransform transform = CGAffineTransform.MakeIdentity();
transform = CGAffineTransform.Scale(transform, transformRatio.Width, transformRatio.Height);
nfloat two = new nfloat (2.0);
nfloat df = -sizeDifference.Width/two;
nfloat dff = -sizeDifference.Height/two;
transform = CGAffineTransform.Translate(transform, df,dff);
resizedGripView.BackgroundColor = UIColor.FromRGBA (17, 176, 13, 50);
item.BackgroundColor = UIColor.Red;
resizedGripView.Transform = transform;
}
Anybody HALP!