Appcelerator. Change image in image view on click - imageview

Titanium SDK version: 1.7.0
iPhone SDK version: 4.2
I am developing an iOS app and I got an image that acts like a button in a row in a table and when I click this image view I want to change the image to another image.
For example if I click the image view which displays picture1.png I want it to show picture2.png after the click.
How can I do this?
I tried e.source.image = "picture2.png"; but this did not work.

Solved it by using:
e.source.image = '../images/picture2.png';

Please remove your Ti.UI.SIZE in TableView and TableViewRow both height and width... It will work

Related

Xamarin.Forms iOS shows "Master" and "Detail" instead of just back icon or menu icon

on Android, my app shows a little arrow in the navigation bar up top that, once clicked on, brings you back one screen. But iOS, ofc is special, shows the word "DETAL" and "MASTER".
The do the same (open the menu, go back) but its wierd.
THis is how I open the page:
button_test.Clicked += delegate
{
Application.Current.MainPage = new Screen_MainMenu();
};
Can someone tell me, what is going on and how to just make it show the arrow and not the words?
Find the code where you set the icon on Page.IconImageSource , you have to ensure the image(back icon) already exists under the resource folder or image assets in iOS project .

How to create a button with image in Xamarin.forms

I want to create a button with cancel option(image).
Please have a look image.
Cancel or button both have different click option.
enter image description hereHow I can achieve this.
You can use simple StackLayout with horizontal orientation and use Tap Gesture for image and label to achieve your target.
Hope this may solve your issue.
The Button has an image property you can define in xaml. Just add the name of your image and make sure it exists in the resources / drawable folders

Enlarge the Image in full view mode after tap on image in xamarin.forms

I am trying to design a view where there is image in small view when i tap on that image i want to enlarge that image in full view in xamarin forms like in whats app when we change the profile pic of application . we saw image in small section then after clicking on image it shows in full section and we got options for edit image ...which views should i used?
Anybody know how i can achieve this
<Image x:Name="image1" HeightRequest="100" WidthRequest="100"/>
You could click on the image and than show a custom dialog with an enlarged picture of it.( you pass the url/base64string between the dialog and main screen).
For the custom dialog part you could use: https://github.com/rotorgames/Rg.Plugins.Popup

How to add context menu Xamarin.forms

I would like to create context menu in my project. On android it's called PopupMenu. On click of button, I have to show the popup with 3 rows and it's clickable event. How I can implement this in my code? Example of this menu here:
http://www.javatpoint.com/images/androidimages/popup2.png
The Xamarin.Forms way to handle this is to call DisplayActionSheet() on the Page.
It's not exactly a popup, but on the other hand it has better chances to be fully displayed and visible on screen if your view can scroll.

How to Keep Same UINavigationView Button across all storyboard views?

So I'm working through the code in this tutorial which has a small button labeled 'Touch Me'. When you tap this it brings up a new view which also has a close button. I've added a screenshot below and you can download the source code here.
The problem I'm having is that I can't seem to port over this .xib code to work in Xcode 4.2 storyboards. I am trying to keep that same 'Touch' button and 'AnotherView' displaying on a brand new 'Master-Detail Application' running iOS 5.
I am struggling to even keep the button displaying on every view. As in, you can tap the button 'Touch Me' to bring up this alternate view at any page - in the table view or the detail view. I hope this makes some sense? Note that I'm NOT talking about the table row, just the top right button in the UINavigationBar.
Please let me know if I can provide any more details! Just trying to build a similar functionality as the 'Touch Me' button in a fresh new iOS 5/Xcode 4.2 Storyboard app WITHOUT any .xib files. thanks in advance
As your know storyboard doesn't use XIBs so you won't be able to follow the tutorial line for line.
I recommended first creating a new storyboard project and select the "Master-Detail Application" template when creating the project. This will create a project with a Navigation controller. You can then follow the tutorial on customizing the navigation bar. When following the first part of the tutorial, you will need to select the initial view,"Navigation Controller", in storyboard and change its class to "KTNavigationBar" after you create that class.

Resources