-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't setHomeAsUpIcon in 1.3.6 using Alloy MVC #68
Comments
Hi @IvoPereira Are you using Titanium 4.0.X ? Maybe it's a bug. Your code looks good. I wonder if providing a density-independent image resource would solve this because the same thing is working in the example. I'd need to change how to resolve the image then. Could be worth a try. |
Hello @manumaticx, I'm using Titanium Studio v. 3.4.1.201410281727 and Titanium SDK 3.5.1.GA. I'm testing on a 4.2.2 device. That snippet is working in the example, however the example does not use MVC and its folder structure (controllers, models, views), and is only based in an app.js file at root. Possibly may be that related to the problem locating the files? As soon as I get office I will try with some density-independent image resources, and I'll let you know the result. Thanks. |
There shouldn't be a difference when using Alloy because Alloy creates a classic project with the same folder structure. I've just tested an fixed-density image and I do get the same error: I recommend you using But I also will try to resolve resources within the |
Hey @manumaticx, Thanks for the feedback. I was trying to follow your suggestion, so I've put the image inside all of the folders you mentioned, using the path: However, it seemed to change something in the location where it was looking for the file, but it was still not able to find it (and the files were moved to Resources folder as expected). |
Hm, I'm not sure what's going on here! I've just created a fresh new Alloy app with Titanium 3.5.1.GA and ABX 1.6.3 to test this. But I am not able to reproduce this error. The resource path in your log is also very strange. It should actually log the path that was passed to If you find anything that could help me to find the reason for this, please let me know. |
I'll be happy to assist you debugging the problem @manumaticx. I've tried with a live device LG-G2 using Ti-Shadow (and without it - through TitaniumStudio directly). The image I'm using is this one: http://i.imgur.com/AR7zIc8.png Let me know if you need anything else. |
@manumaticx strange but I get a similar error
and the ic_menu_black_24dp.png is in app/assets/android. Also tried with a / prefix and still not found |
@ndastur as stated in the above comment I'd recommend using |
@manumaticx thanks. I have been looking into the code and I think it is because you are using the getResourceId helper function. Looking deeper into the Appc source this seems to be a deeper level function. Looking at how Appc resolve the setIcon in their actionbar implementation |
Specific bit of code that might help is
|
@ndastur Thank you for this. Do you think there is a chance that you could build the module and test this? |
Unable to setHomeAsUpIcon with titanium 4.0.X Can any one help me out. |
@ChanakyaSrinivas Hi there, I need some more info! This is not considered as a bug until you instruct me how to reproduce the issue. |
@ChanakyaSrinivas try adding if (actionBar){
actionBar.displayHomeAsUp = true;
abx.setTitle("Example");
abx.setHomeAsUpIcon("/images/drawericon.png");
} |
As per your suggestion changed my code. |
Great. Nice to hear. So I think I can close this issue here since Please feel free to reopen if you can provide test code to reproduce this issue. |
Hi All, Module is not working for Titanium SDK 5.3.1GA and Alloy 1.8.7 Environments: Error:
|
@ChanakyaSrinivas Try updating the Module |
Hello,
I'm using Alloy MVC, and inside of one of my controllers, I'm using the following:
I do have an image in /PROJECT_NAME/app/assets/images/icon_menu.png, and my controller is located in /PROJECT_NAME/app/controllers/example.js.
Just to note that all the others images for example in Titanium ImageViews load fine, using the same schema.
When starting my application, the title do change to "Example", however the homeAsUpIcon does not change and an error is shown in console:
I've already tried to play with slashes and some folder derivations in icon location, but I am not being able to get it work. Is it possible this is a bug in the module?
Thanks
The text was updated successfully, but these errors were encountered: