Using Titanium Appcelerator SDK 1.7.1 for iOS 4.3
I have a TableViewRow and need to fire a custom swipe event on it (rather than the default editable delete) so that I can show 2 buttons. One marking the row as complete, the other removing the row.
The problem is that apparently the swipe event isn't allowed on the TableViewRow element.
I've tried using the Swipe event, the touchstart event and the touch move event, all with a callback of alert('woot! your finger moved!') but the callback is never fired ...
Has anybody had and resolved this issue?
This should work.
myTableview.addEventListener('swipe', function(eventObject){
Titanium.API.info("huzzah, a row was swiped");
});
What does your code look like?
EDIT:
Do your rows have data in them? If not see if putting data in your rows help.
EDIT:
These are the events that are passed to the swipe event so you can get the row swiped with source.
direction direction of the swipe - either left or right
globalPoint a dictionary with properties x and y describing the point of the event in screen coordinates
source the source object that fired the event
type the name of the event fired
x the x point of the event in receiving view coordiantes
y the y point of the event, in receiving view coordinates
Related
I'm working on a graphic editor application, and I would like to insert tokens in my textfield when user select graphic items.
The problem is that I don't receive mouse down event when the textfield is firstResponder.
Is there a way to get events while keeping the textfield first responder ?
I've spent the last couple of days reading through docs and answers trying to get a solution for this. So I resort to this, with a probability of being a duplicate, as a cry for help.
I have a GestureOverlay panel to read horizontal swipe gestures. This sits on top of a view pager.
I need to disable the functioning of the view pager when the touch event is read on the gesture panel.
I've extended ViewPager to let me enable and disable it with a member method.
Overrode the onTouch event of gesture to return true (consume the event) and disallow Intercept touch event on its parent (only on action_move/down). I also tried to disable the view pager onTouch, but the viewpager's on touch event is fired first
How do I achieve this?
I have a listView and when the receive a message, the listview should scroll to the end only, if it already in the end.
To make it clear, if the user is seeing old message, the listview shouldn't scroll to the end automatically, but if the is already on the on the listview when receiving a message the listview should automatically scroll to the end.
So I have to get the actual position of the ListView, I didn't see any property or method similar to get this position on the API.
So I was thinking if is possible to override an event like OnScroll, so I can save the current position of the ListView without using custom render.
This can be done using XamarinForms?
ListView doesn't fire Scrolled events like ScrollView does, but it does fire ItemAppearing and ItemDisappearingevents that you may be able to use to keep track of which items are currently visible.
When you push down the left mouse button mouse down event fires. If you then move the mouse over a label (while holding the mouse button down) mouse over event does not fire.
Is there any way to enable this events or fire them manualy or simulate them?
What you are actually doing is two separate events, one is a mouse down event as you have described and the other is a mouse drag.
If you want to simulate them, that you might have to consider using a mouse click to track the user's (x,y) location. Subsequently, if you want to "simulate" it you could do some computation and decide for yourself if it is indeed a mouse click or mouse drag event that has occurred.
Hope it helps :) Cheers!
If you tap on the left hand side of the screen in Outlook then an event is triggered (in this case a checkbox appears).
I would like to know the xaml on how this is achieved. It cannot be a simple "MouseLeftButtonUp" event because if you drag your finger more than a few pixels then the event does not trigger.
In my own app I am trying to get an icon appear within a listbox that has a SelectionChanged event. The issue is that if you do not touch the small icon precisely then you are triggering the listbox event rather than the event I want to occur when pressing the image.
I think I need to wrap my image in a Canvas but then am still stuck as to what the event should be.
How do you increase the target size of the area where a user can click on your element?
What event should an image have when within a listbox (which is within a pivot) that has a SelectionChanged event? (MouseLeftButtonUp causes issues if you half drag to the next pivot and lift your finger - it triggers the MouseLeftButtonUp event)
I implemented something very similar to that behavior by making an itemtemplate where the checkbox was pushed offscreen to the left by using a negative margin.
I then created 2 visual states, one for Open and Closed. The open state set the margin to 0, bringing the checkbox back onscreen. Closed state had the negative margin.
With the fluidmove behavior, switching between states on button press was EASY. The only thing you'd have to add would be an invisible button/touch area on the left that would also trigger "opening" the checkbox column (changing state to reset the margins).
Hope that helps...
The outlook app is a native app, so it probably isn't using xaml at all.
If you're worried about the mouse events, then you should look at the gesture stuff in the silverlight toolkit, it contains tap, etc events that make a little more sense on the phone.
Increasing the target size and generally making stuff touchable: wrap it in a Button, then alter the ControlTemplate for the Button to remove the border.
If you look at the ControlTemplate for a Button, (Expression Blend, Edit Template, Edit a copy) you'll see the mechanics of the touch area. It's nothing more than padding/margin.
Thus, you can't bleed your touch region out without altering the layout and affecting other items around the control. I'd do two things:
First, I'd think about whether my whole control should be larger in the first place with good spacing around it. Is my design right?
Second, I'd cheat. I'd float a fixed sized button with no border over the area using the Translate transformation to move it around freely.
Good luck,
Luke