我创建的UITabBarController类有5个 ViewControllers
controller1 = new Controller1();
controller2 = new Controller2();
controller3 = new Controller3();
controller4 = new Controller4();
controller5 = new Controller5();
controller1.TabBarItem = new UITabBarItem ("first", UIImage.FromFile("/Images/first.png"), 0);
controller5.TabBarItem = new UITabBarItem ("second", UIImage.FromFile("/Images/four.png"), 1);
controller5.TabBarItem = new UITabBarItem ("third", UIImage.FromFile("/Images/four.png"), 2);
controller5.TabBarItem = new UITabBarItem ("four", UIImage.FromFile("/Images/four.png"), 3);
controller5.TabBarItem = new UITabBarItem ("five", UIImage.FromFile("/Images/four.png"), 4);
var tabs = new UIViewController[] {
controller1, controller2, controller3, controller4, controller5
};
ViewControllers = tabs;
Run Code Online (Sandbox Code Playgroud)
在第三个控制器中,我有一个提交按钮.
在提交按钮的动作,我想从切换标签controller3到controller5.
我该怎么做呢?
从Photolibrary中提取图像我们使用UIImagePickerViewController和UIImagePickerControllerSourceTypePhotoLibrary进入Photolibrary并获取图像,现在我的问题如何获取保存在我的photoLibary中的图像数.
允许我在我的应用程序中显示图像计数.
-(void)initialization
UIPanGestureRecognizer *panRecognizer = [[[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(move:)] autorelease];
[panRecognizer setMinimumNumberOfTouches:1];
[panRecognizer setMaximumNumberOfTouches:1];
[panRecognizer setDelegate:self];
[imageview addGestureRecognizer:panRecognizer];
}
- (void)move:(UIPanGestureRecognizer *)gestureRecognizer
{
UIView *piece = imageview;
[self adjustAnchorPointForGestureRecognizer:gestureRecognizer];
if ([gestureRecognizer state] == UIGestureRecognizerStateBegan || [gestureRecognizer state] == UIGestureRecognizerStateChanged) {
CGPoint translation = [gestureRecognizer translationInView:[piece superview]];
CGPoint translatedCenter = CGPointMake([piece center].x + translation.x, [piece center].y + translation.y);
CGPoint center = [self centerWithBounds:translatedCenter andViewFrame:[piece frame] andBoundingFrame:[[piece superview] frame]];
[piece setCenter:center];
[gestureRecognizer setTranslation:CGPointZero inView:[piece superview]];
}
}
Run Code Online (Sandbox Code Playgroud)
我将手势添加到imageview,而不是调用移动动作.
如何将手势添加到UIImageView ..
如何为LoginViewController隐藏NavigationBarHidden并显示DashBoardViewController
window = new UIWindow (UIScreen.MainScreen.Bounds);
navigationController = new UINavigationController();
loginViewController = new LoginViewController ();
navigationController.SetNavigationBarHidden (true,true);
navigationController.AddChildViewController (loginViewController);
if (validAuth == "AuthenticationValidUser" ){
var dashBoardViewController = new DashBoardViewController ();
navigationController.SetNavigationBarHidden (false,true);
navigationController.AddChildViewController (dashBoardViewController);
}
window.RootViewController = navigationController;
window.MakeKeyAndVisible ();
return true;
Run Code Online (Sandbox Code Playgroud)
请告诉我正确的方法.
@All先谢谢.
如何获得适用于iOS的Xamarin click活动UIImageView?
public UIImageView img_UploadImage { get; set;}
public ConstructorClasss(){
img_UploadImage = new UIImageView();
img_UploadImage.Frame = new RectangleF(100,100,60,50);
img_UploadImage.Image = UIImage.FileName ("UploadLocal.png");
}
Run Code Online (Sandbox Code Playgroud)
我需要使用手势点击UIimageview还是有任何click事件UIImageView?
钛有一个click事件UIImageView有actionListner.请告诉我clickXamarin 有什么事吗?
如何从定义如下的字符串中提取数字:
NSString *getNumber = @"Price138.50 Code112.250"
Run Code Online (Sandbox Code Playgroud)
我需要从这个字符串中提取138.50和112.25.
我尝试在第一步设置 Jenkins,运行命令“java -jar jenkins.war”时出现以下错误
SEVERE: Running with Java class version 55.0, but 52.0 is required.Run with the --enable-future-java flag to enable such behavior. See https://jenkins.io/redirect/java-support/
java.lang.UnsupportedClassVersionError: 55.0
at Main.main(Main.java:139)
Jenkins requires Java 8, but you are running 11.0.1+13-LTS from /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home
java.lang.UnsupportedClassVersionError: 55.0
at Main.main(Main.java:139)
Run Code Online (Sandbox Code Playgroud)
任何人都可以指导我如何解决这个问题吗?
我希望能够仅使用Apple Framework绘制图形.
这可能只使用CoreGraphics,还是我需要使用任何其他框架?
我不想使用任何第三方框架来绘制图形.
当进入前台时,ProgressIndicator(MTMProgressHub)不会出现
hud = new MTMBProgressHUD (View);
View.BringSubviewToFront (hud);
View.AddSubview (hud);
hud.Show (true);
Run Code Online (Sandbox Code Playgroud)
请找到下面的图片
如图中所示,进度指示器位于按钮的背面(注册登录,请联系我们)。
public LoginViewController(){
hud = new MTMBProgressHUD (View);
View.BringSubviewToFront (hud);
View.AddSubview (hud);
hud.Show (true);
Run Code Online (Sandbox Code Playgroud)
}
无法将其推到前面。
下面是解析的 json 数据,其类型为string.
"data": [\n {\n "Company": {\n "id": "1",\n \xe2\x80\x9cValue": \xe2\x80\x9c20\xe2\x80\x9d,\n "companyId": "2001\xe2\x80\x9d,\n }\n },\n {\n "Company": {\n "id": "2",\n \xe2\x80\x9cvalue\xe2\x80\x9d: "20\xe2\x80\x9d,\n "companyId\xe2\x80\x9d: "2002\xe2\x80\x9d,\n }\n },\n {\n "Company": {\n "id": \xe2\x80\x9c3\xe2\x80\x9d,\n \xe2\x80\x9cvalue\xe2\x80\x9d: \xe2\x80\x9c30\xe2\x80\x9d,\n "companyId\xe2\x80\x9d: "2003\xe2\x80\x9d,\n }\n },\n ]\n\nvar parseData = Newtonsoft.Json.Linq.JObject.Parse (e.ResponseData.ToString ());\nRun Code Online (Sandbox Code Playgroud)\n\n转换json数据字符串存储在数组中,存储公司值的Arraylist。\n这是第一次处理Json对象字符串。
\n团队,
我有两个故事板。一个用于身份验证,另一个用于我的应用程序仪表板。
对于身份验证故事板,初始化屏幕是 loginScreen。登录成功后,我正在加载仪表板故事板。对于仪表板故事板,初始屏幕是 MainViewController。
在这里,我在 DashboardStoryboard 中实现了注销。所以现在我想切换回我的身份验证故事板。
在这里它回到loginScreen。但我认为这不是实施的正确方法。有什么方法可以做得更好吗?
-(void)logout{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Authentication" bundle: nil];
LoginViewScreenController *loginViewScreenController = [storyboard instantiateViewControllerWithIdentifier:@"LoginViewScreenController"];
[self.navigationController pushViewController: loginViewScreenController animated:NO];
}
Run Code Online (Sandbox Code Playgroud)
非常感谢您的反馈。
ios ×7
c# ×5
xamarin ×5
iphone ×3
objective-c ×2
arrays ×1
cocoa ×1
cocoa-touch ×1
ipad ×1
java ×1
jenkins ×1
json ×1
nsstring ×1
photolibrary ×1
storyboard ×1
tabbar ×1
uiimageview ×1
uistoryboard ×1
xamarin.ios ×1