3
我正在使用MonoDevelop和xamarin創建iOS應用程序。iOS,Xamarin,UIView,繪製,動態動畫不起作用
我有一個觀點,看起來像這樣:
public class MyView: UIView
{
private Timer _t = new Timer(1000);
private int _i = 0;
public MyView()
{
_t.Elapsed += (sender, e) => {
_i = (_i + 1) % 100;
this.Draw(new Rectangle(0, 0, 110, 110));
};
_t.Enabled = true;
}
public override void Draw(RectangleF rect)
{
base.Draw(rect);
var uiImage = UIImage.FromFile("myImage");
var uiImageView = new UIIMageView(new Rectangle(_i, 0, 10, 10));
uiImageView.Image = uiImage;
AddSubView(uiIMageView);
}
}
我希望我的形象會移動。但結果我只有初始靜態圖像。任何人都可以建議如何做動畫嗎?