currently i have been working in a project to create chat client support emoticons icons, but i facing a problem that in my titanium appcelerator project i must load > 100 emoticons in a view. The fact that titanium appcelerator load multi images very slow, and i don't know why it happen, can someone suggest me a solution to resolve this problem ?
assuming your UI implementation can support it; load a single image that has all ~100 emoticons and add a touchend event listener to the image view. the even returns the x,y coordinate which you can then map to the emoticon that was selected.
var self = Ti.UI.createView({backgroundColor: '#666'});
var emoticons = Ti.UI.createImageView({
image: 'http://www.berkeley.edu/news2/2013/04/Finch300.jpg'
});
emoticons.addEventListener('touchend',function(e){
alert('x: '+e.x+' y: '+e.y);
})
self.add(emoticons);
Related
I created a hybrid app with Vue.js. Can I write a keyboard accessoryView in Vue code that exists in ios? Or is there a way to fix the custom accessoryView by detecting the keyboard coming up and calculating the height? I failed in both ways.
I guess that Visual Viewport API can be useful as shown in this tweet: https://twitter.com/rikschennink/status/1361598959828037633
visualViewport.addEventListener('resize', () => {
console.log(window.innerHeight);
console.log(visualViewport.height);
})
But for the specific accessoryView property/method, I guess that you need to add some iOS tags for this question to be noticed by those people.
First of all, thanks to everything of codenameone.
I would like to customize camera view, simply overlaying PNG image on the full camera view screen.
Any way how to do it?
Here is code snippet.
Form mainForm = new Form();
ImageViewer iv = new ImageViewer();
mainForm.getToolbar().addMaterialCommandToRightBar("",
FontImage.MATERIAL_CAMERA_ALT, 4, (ev) -> {
filePath = Capture.capturePhoto();
setImage(filePath, iv);
});
I couldn't any view component of camera view, because Capture.capturePhoto() works automatically.
Or is there any way to build custom camera component in codename one?
I googled and got about PeerComponents, however don't know how to use it.
Just please provide some small sample code for me.
Best regards.
Currently Capture.capturePhoto() opens its own "window" over the app so you can't customize it. In the future we will likely add a more flexible API to embed the camera into your UI, especially now that we have Z-layering (we can draw over top of native widgets).
If you need this functionality right now, you would need to write a native interface and make your own capture component.
currently i am working on native map in Titanium for android and iOS.
you might have seen native maps on which a custom image layer or layout is being displayed, which will rotate and zoom according to the user input (currently i am not talking about annotations)
i have tried using annotation map tile too but it doesn't seems to work as the native map app i have seen
if you have any question or are not able to understand my question please let me know so i could clarify and get solution for one of you
Update:
Can you give a better explanation of what you've tried?
you might already know about mapbox.com and leafletjs.com, by using their library we could make customize maps and offline map in webview but i am looking for some Titanium module which could help me use native map of iOS and android for performing similar functionalities(i am avoiding commercial library and plugins as my app is not commercial app). i want to create map tiles which could be used for offline purpose as the user would have downloaded with the app.
what i have tried yet!!
1: http://i.stack.imgur.com/CLiNh.jpg
2: http://i.stack.imgur.com/QOLO7.jpg
in first image link i have given image in which i showing screenshot of map with rotation (if you notice compass) and the map tile moved accordingly to it
in 2nd image ... i had put a map tile using createAnnontation function, but unable to fix its layout remains same and it doesn't resize when i do zoom in/out too
I assume you are talking about custom tiles on top of a MapView.
There is an example module for iOS at https://github.com/benbahrenburg/benCoding.Map which used the Titanium map module as a base. It is a bit dated, but see the TileOverlay example and code and it will get you on the right track.
The best tutorial I've found on how to create the tiles is at http://www.ericbinnion.com/creating-custom-overlays-for-ios-mapkit-framework/
I've tried to create a similar TileOverlay functionality by forking the Android map module with limited success. I never got it to work as well as the native maps.
You could also check out using Mapbox with Titanium. There are great tutorials and tools for creating your own tiles layers and manipulating existing layers. Adam Paxton gave a great demo of it at TiConf in New York this year.
I want to hide the screen splah of my app and i'm trying to do this with Cordova function navigator.splashscreen.hide() according to this
function wlEnvInit(){
wlCommonInit();
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
alert("device is ready!");
navigator.splashscreen.hide();
}
}
I placed this code on android/js/myAppName.js and iphone/js/myAppName.js folders. It does not work. There is something wrong?
I assume what you're trying to do is to hide the splash image at a point in time based on your own preference? This is currently not possible.
Worklight bypasses Cordova's splash image mechanism as well as does not provide an API to manipulate its duration programmatically (= choose when to hide it). This is an area that is destined to change in a future release.
If what you're trying to do is to simply not show a splash image at all, then:
In iOS: this is not possible. The splash image is mandatory by Apple
In Android: simply delete the splash.9.png image file from the yourProject\apps\yourApp\android\native\res\drawable folder
BTW, I do not see the use for the deviceready listener, because if you've reached wlCommonInit, then the device (Cordova...) has already been initialized. The app would not have functioned otherwise.
For the time being, a workaround for it would be by replacing the Splash screen image with a complete white background screen/image.
I create a new iOS project in XCode 5. I choose to use asset catalog for both app icons & launch images. When I run the application, the app icon is overlayed on the launch image. How do I prevent this?
This is my app icon:
This is launch image:
I get this as the launch image on the simulator (and in device)
For those who come here searching, I solved this issue. The launch images should be opaque and not transparent.
I used iDraw to create the launch image. Instead of exporting the entire canvas, I selected 'all objects' which created a transparent image, which caused this issue.
Now it is solved and submitted to AppStore