我覺得Anuj回答大部分 - 除了標識部。你可能想要一個像他所建議的那樣好的,漸變式的背景(並且應該得到;-)的榮譽。
從那裏創建透明(背景)徽標並將其添加到背景頂部可能更容易。要做到這一點,您可以在DialogViewController
內的TableView
中添加一個UIImage
,您將使用它。
還有很多其他的方法來做到這一點。這一個確保您的MT.D元素將顯示在您的徽標所在的TableHeaderView
的正下方。
這裏有一個快速(非常髒)示例代碼在標題中添加圖像:
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
var root = new RootElement ("Welcome to MonoTouch") {
new Section (String.Empty) {
new StyledStringElement ("I'm already a MonoTouch user") {
Accessory = UITableViewCellAccessory.DisclosureIndicator
},
new StyledStringElement ("I'm new to MonoTouch") {
Accessory = UITableViewCellAccessory.DisclosureIndicator
}
}
};
var dv = new DialogViewController (root) {
Autorotate = true
};
var data = NSData.FromUrl (new NSUrl ("https://github.com/xamarin/monotouch-samples/blob/master/AVCaptureFrames/Images/Icons/114_icon.png?raw=true"));
var logo = UIImage.LoadFromData (data);
dv.TableView.TableHeaderView = new UIImageView (logo);
navigation.PushViewController (dv, true);
window.MakeKeyAndVisible();
// On iOS5 we use the new window.RootViewController, on older versions, we add the subview
if (UIDevice.CurrentDevice.CheckSystemVersion (5, 0))
window.RootViewController = navigation;
else
window.AddSubview (navigation.View);
return true;
}
嗨@Anuj怎麼樣的按鈕在視圖的底部對齊? – 2012-03-01 02:26:15
對於我來說,這不適用於任何iPad(模擬器,真實設備,視網膜和非視網膜)。任何想法? – Timm 2012-03-27 13:15:50
另外,嘗試在推到另一個屏幕後進入屏幕,並且無法看到對話框。必須將代碼移到'ViewWillAppear'。 – Timm 2012-03-27 13:22:25