ios开发什么样的菊花是最好的用户体验
1个回答
展开全部
有一个叫UIActivityIndicatorView的类,它就是能实现。首先我们要是new出一个对象,然后对这个对象进行一些简单的操作。比如说,大小,位置,圆角,菊花的颜色,背景颜色,何时启动这个菊花,何时停止这个菊花。
下面这个例子,我们要在导航栏上面进行一些操作,左右按钮能够实现菊花的启动和停止。首先,我们要设置导航栏的根视图,然后将菊花加到这个里面,代码如下:
[csharp] view plain copy
namespace IndicatorClass
{
public partial class ViewController : UIViewController
{
UIWindow window;
public ViewController (IntPtr handle) : base (handle)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
//根视图
window = new UIWindow (UIScreen.MainScreen.Bounds);
window.RootViewController = navi;
window.MakeKeyAndVisible ();
UIActivityIndicatorView ActivityIndicatorView=new UIActivityIndicatorView(new CoreGraphics.CGRect(0f,0f,100f,100f));
ActivityIndicatorView.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge;
ActivityIndicatorView.Center = this.View.Center;
ActivityIndicatorView.BackgroundColor = UIColor.DarkGray;
ActivityIndicatorView.Layer.CornerRadius = 10f;
//导航栏
UINavigationController navi = new UINavigationController (this);
NavigationItem.Title="菊花";
UIBarButtonItem rightButton=new UIBarButtonItem("开始",UIBarButtonItemStyle.Done,delegate(object sender, EventArgs e) {
ActivityIndicatorView.StartAnimating();
});
下面这个例子,我们要在导航栏上面进行一些操作,左右按钮能够实现菊花的启动和停止。首先,我们要设置导航栏的根视图,然后将菊花加到这个里面,代码如下:
[csharp] view plain copy
namespace IndicatorClass
{
public partial class ViewController : UIViewController
{
UIWindow window;
public ViewController (IntPtr handle) : base (handle)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
//根视图
window = new UIWindow (UIScreen.MainScreen.Bounds);
window.RootViewController = navi;
window.MakeKeyAndVisible ();
UIActivityIndicatorView ActivityIndicatorView=new UIActivityIndicatorView(new CoreGraphics.CGRect(0f,0f,100f,100f));
ActivityIndicatorView.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge;
ActivityIndicatorView.Center = this.View.Center;
ActivityIndicatorView.BackgroundColor = UIColor.DarkGray;
ActivityIndicatorView.Layer.CornerRadius = 10f;
//导航栏
UINavigationController navi = new UINavigationController (this);
NavigationItem.Title="菊花";
UIBarButtonItem rightButton=new UIBarButtonItem("开始",UIBarButtonItemStyle.Done,delegate(object sender, EventArgs e) {
ActivityIndicatorView.StartAnimating();
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |