I'm new to mobile development with Titanium Studio. I was using tabgroup controller and it was working fine with IOS simulator version 5.1. But when I upgraded to IOS 6, when I tried running the same code I got the error below,
Script Error = -[UITabBarController setSelectedViewController:] only a view controller in the tab bar controller's list of view controllers can be selected. at app.js (line 45).
And here is my code:
var tabGroup = Titanium.UI.createTabGroup();
var win = Titanium.UI.createWindow({
navBarHidden: true,
tabBarHidden: true,
url:'example.js',
});
var tab1 = Titanium.UI.createTab({
height: 30,
window:win,
});
tabGroup.addTab(tab1);
tabGroup.addEventListener('open', function(){
tabGroup.setActiveTab(tab1);
})
tabGroup.open();
Please tell me if I can do something to solve it. Or if I can downgrade the simulator to 5.1 because I don't find the IOS simulator 5.1 in Run Configuration.
Thanks in advance.
This is fixed by updating your titanium SDK to the latest version. (Currently 2.1.3 RC2 http://developer.appcelerator.com/blog/2012/09/titanum-2-1-3-rc2-is-released-with-additional-fixes-for-ios-6-and-iphone-5.html)
I had the same issue and this fixed it for me.
Related
i have an issue with Xcode Previews. If I create a new project, previews is working fine but on my active application that's was build with Mojave on SwiftUI isn't working.
I even made a new Project and dragged all files to the new project but something seems to be wrong with some file that this happens.
I always get this error in Previews:
Failed to build active scheme
See this:
Check out the Xcode Report navigator for more information about the issue.
Omg after spending almost 1:30 hours on it I found out that in one fine I had this:
#State private var tappedBarIndex = 0 {
didSet {
print(self.tappedBarIndex)
}
}
Its doesn't work if you have didset
In the iOS cordova app which i am currently developing the status bar is initially hidden.
Within the app i am accessing Camera and Device Gallery in order to get the images.
for Device Gallery
navigator.camera.getPicture(
successCB,
failCB,
{
quality : 50,
sourceType : Camera.PictureSourceType.PHOTOLIBRARY,
destinationType : Camera.DestinationType.DATA_URL,
correctOrientation : true
});
Whenever i access the device photo gallery plugin, the status bar is visible on top of my app.
Tried using Cordova Status Bar Plugin, used the below code for hiding the status Bar.
StatusBar.hide();
Its doesnt seems to be working.
iOS SDK : 8.1
Any help is highly appreciated.
thanks
the issue is with the success callback of cordova camera plugin.
the below code was not getting executed properly.
StatusBar.hide();
So tried using setTimeout which did the trick as shown below.
setTimeout(function(){ StatusBar.hide();}, 0);
Please refer Cordova Camera plugin iOS Quirks
I have a very simple view with a button and a label. In XCode's Interface Builder I ctrl-dragged to get a reference to the UIButton and called it btnPlay. In my view controller I have this code:
public override void ViewDidLoad()
{
base.ViewDidLoad();
// On my phone this line causes a crash:
Console.WriteLine("Button title: {0}", btnPlay.CurrentTitle);
}
When I run the app in the iPhone Simulator (3.5" Retina / iOS 7.0) all is well. Inspecting btnPlay at a breakpoint shows it as a MonoTouch.UIKit.UIButton object.
When I run the app on my iPhone 5C (iOS 7) btnPlay shows up as a MonoTouch.UIKit.UIView object which has no CurrentTitle property and so crashes the app.
What can be the cause of this?
More info:
A stack trace from the device log crash
report
My setup: Xamarin Studio V 4.2.2 (build 2) * Mono 3.2.5 * Xcode 5.0.2 (3335.32) * Xamarin.iOS Version: 7.0.4.209 (Indie Edition) * Build date: 2013-11-11 16:04:00-0500
In my view's .designer.cs class the property is of type MonoTouch.UIKit.UIButton
In the .xib file it is a <button>
Deleting the app from the phone and running a clean build doesn't solve the issue
I can't reproduce the behaviour in a simple app with just one view and one button, so I'm asking for clues where to start looking for the problem
I have created an app in Titanium Appcelerator. The app worked fine up until the iPhone 5 came out and ios 6. The issue is in the button bar the buttons are larger than they should be. They overlap the bar.
Here is an image as well as the code for the button. Has anyone ran into this issue before?
http://postimage.org/image/thlu3i8pf/
var statusButton = Titanium.UI.createButtonBar({
labels:['Open', 'Closed'],
backgroundColor:'#336699'
});
Make sure you're using Titanium SDK 2.1.4 or newer -- 2.1.3 & 2.1.4 contain a number of fixes for iOS 6 and iPhone 5.
You need to add height.
var statusButton = Titanium.UI.createButtonBar({
labels:['Open', 'Closed'],
backgroundColor:'#336699',
height: 40
});
I need a view in my app to refresh everytime the app comes back to the foreground. The code below is working perfectly with Android but nothing happens on iOS.
$ionicPlatform.on('resume', function() {
if($state.current.name == "app.listar_aprovacoes"){
// code to refresh scope and view.
};
});
I also tried the following and it also doesn't work with iOS:
document.addEventListener("resume", function() {
var alertPopup = $ionicPopup.alert({
title: 'Foo',
template: 'Bar'
});
}, false);
So could you help me out with a solution to this problem?
Thanks!
EDIT: For some reason, updating the platform using ionic platform update ios didn't update the code for this. I removed the platform and added it again and it started working.
Try using window.addEventListener('resume', callback); as well.
Also make sure you have the Cordova Device Plugin.
You can install it by using:
ionic plugin add cordova-plugin-device
Generally, with the plugin installed, the first ($ionicPlatform.on('resume', ...)) method should work. I tested both on iOS and Android.
For some reason, updating the platform using ionic platform update ios didn't update the code for this. I removed the platform and added it again and it started working.