Xamarin.ios 使用monotouch定制视图
我正在开发的monotouch应用程序中有一个视图,上面有许多按钮。这个想法是,当我点击其中一个按钮时,从底部打开一个子视图(像键盘一样),上面有滑块和文本视图(每个按钮都有一个不同的子视图可以滑入) 我环顾四周,似乎找不到如何做到这一点。我知道这是可能的,因为我在很多应用程序上都看到了这一点Xamarin.ios 使用monotouch定制视图,xamarin.ios,Xamarin.ios,我正在开发的monotouch应用程序中有一个视图,上面有许多按钮。这个想法是,当我点击其中一个按钮时,从底部打开一个子视图(像键盘一样),上面有滑块和文本视图(每个按钮都有一个不同的子视图可以滑入) 我环顾四周,似乎找不到如何做到这一点。我知道这是可能的,因为我在很多应用程序上都看到了这一点 如果您有任何建议,我们将不胜感激。您所描述的内容听起来像是一场灾难。如果这不符合您的需要,那么创建一个新的UIView并使其显示就很简单了——只需设置它的Frame属性并使用AddSubview(可能带有
如果您有任何建议,我们将不胜感激。您所描述的内容听起来像是一场灾难。如果这不符合您的需要,那么创建一个新的
UIView
并使其显示就很简单了——只需设置它的Frame
属性并使用AddSubview
(可能带有一个动画使其向上滑动)
也许您需要的是actionsheet?尝试将视图中的
UITextView
设置为自定义视图。当其中一些设备接收到焦点时,将显示InputView
,而不是默认键盘。
protected void HandleBtnActionSheetWithOtherButtonsTouchUpInside (object sender, EventArgs e)
{
actionSheet = new UIActionSheet ("action sheet with other buttons");
actionSheet.AddButton ("delete");
actionSheet.AddButton ("cancel");
actionSheet.AddButton ("a different option!");
actionSheet.AddButton ("another option");
actionSheet.DestructiveButtonIndex = 0;
actionSheet.CancelButtonIndex = 1;
//actionSheet.FirstOtherButtonIndex = 2;
actionSheet.Clicked += delegate(object a, UIButtonEventArgs b) {
Console.WriteLine ("Button " + b.ButtonIndex.ToString () + " clicked");
};
actionSheet.ShowInView (View);
}