0
試圖在MonoTouch.Dialog中的自定義ImageElement中居中放置圖像時,出現了一些問題。我已經嘗試過幾乎每一項技術都在本書中,從設置圖像的中心到小區的中心,調整內容模式等在ImageElement中居中放置圖像
我目前的做法:
public class MoveButtonElement : ImageElement, IElementSizing
{
UIActionSheet ActionSheet;
UIActionSheetDelegate ActionSheetDelegate;
static NSString key = new NSString ("ButtonElement");
public MoveButtonElement() : base (null) { }
protected override NSString CellKey
{
get
{
return key;
}
}
public float GetHeight (UITableView tableView, NSIndexPath indexPath)
{
return 53;
}
public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath path)
{
// SetupAndShowActionSheet (dvc);
}
public override UITableViewCell GetCell (UITableView tv)
{
var cell = base.GetCell (tv);
cell.BackgroundView = null;
cell.BackgroundColor = UIColor.Clear;
cell.ContentMode = UIViewContentMode.Center;
cell.SelectionStyle = UITableViewCellSelectionStyle.None;
cell.ImageView.Image = Images.MoveVerseButton;
cell.ImageView.ContentMode = UIViewContentMode.Redraw;
return cell;
}
}
不幸的是,無法讓這個寶寶上班。 – pierceboggan