3
我使用MonoTouch.Dialog和幾個剖面創建了一個視圖。這些部分需要在其他部分之前添加圖像,但是我很努力將UIImage添加到第一部分之前的區域。將圖像添加到Monotouch.Dialog中的剖面
我該怎麼辦?我已經強調了RootElement中我希望圖像去的地方。
public void HomeScreen()
{
var root = CreateRoot_HomeScreen();
var dv = new DialogViewController (root, true);
navigation.PushViewController (dv, true);
}
RootElement CreateRoot_HomeScreen()
{
// Set up the ImageView with the Logo in it
var logo = UIImage.FromFile("Images/logo.png");
var imageView = new UIImageView(logo);
return new RootElement("iEngage"){
// The Image should go here
new Section(){
},
new Section("")
{
new StyledStringElement ("Search", delegate{ Console.Write("Clicked"); })
}
};
}
感謝poupou。我試過這個,我得到了一個扭曲的圖像,這個圖像被拉伸/扭曲以適應剖面的寬度和高度。我可以在其他地方指定這些寬度和高度嗎? – Darbio
poupou,我研究出如何通過設置UIImageView的框架屬性來改變高度 - 謝謝。 – Darbio
很高興你收到了,不要猶豫,編輯我的答案,並添加這個,如果你認爲它會幫助人們! – poupou