Swipe multiple UIViews in swift - swipe

I need to use view swipe gesture down, up, left and then right. But on swift UISwipeGestureRecognizer has predeterminate right direction. And I don't know how make this for use other directions.

You can achieve different swipe direction using code and Storyboard as well.
Using Code
var swipeLeft = UISwipeGestureRecognizer()
swipeLeft.direction = UISwipeGestureRecognizerDirection.Left
//Use following Directions as you need
//UISwipeGestureRecognizerDirection.Right
//UISwipeGestureRecognizerDirection.Up
//UISwipeGestureRecognizerDirection.Left
Using Storyboard:
Select the gesture and in Attribute Inspector select the direction. see the screen shot.
Note: You will need 4 different gesture recognisers for 4 directions

Related

Circular Slider in WPF

I really want to create circular slider. I've been searching, but I can't find any information. So any tutorial, guide or if someone already created like this. Please post their XML code.
Instead of making a circular slider (which as #auburg points out) would be a little unintutive to use (think the old telephone dials), consider making it a dial like a thermostat:
It's functionally very similar, but has a much larger hit-test area and is therefore less easy to mess-up for the user.
Try this guide: https://blogs.msdn.microsoft.com/jerrynixon/2012/12/06/walkthrough-building-a-sweet-dial-in-xaml-for-windows-8/
A circular slider can be implemented just like a normal horizontal or vertical slider. The only difference would be that in the MouseMove event handler of the thumb during the drag operation you cannot just handle the horizontal or vertical position. Instead you have to calculate the angle relative to the center of the slider and map that to the value of the slider.

WPF How to disable rotation of some elements while screen rotate?

I am currently creating Win 8.1 universal app. It should have both landscape and portrait view. But only difference between these two states is, that some elements just "turn" to proper direction, while main grid will not rotate.
I don't have enough reputation so here is link to picture of my notion
Is there any way to disable state change rotation only within some elements or do I have to detect the screen orientation and just rotate the desired elements?
This is rather a simple issue and you should implement your second method:
Identify the elements that should not rotate
Rotate them the opposite direction to the screen

Silverlight MapLayer right click issue

I am currently developing a Silverlight OOB application using the Bing Map Control, however I have come across an issue I am struggling to resolve. Basically I have three map layers:-
Base Map (bottom layer)
Icon / Pushpin layer (middle layer)
Shape / drawing layer (top layer)
This all works fine, I have put mouse right click functionality on each of my icons (pushpins if you prefer), if I add a map polygon or polyline to the top layer and this item happens to cover the same area as one of my icons in the middle layer I can no longer get any of the mouse events to fire on my icon.
If anyone can think of a way I can pass the mouse operations from my top layer objects to the middle layer objects please let me know.
Many thanks in advance
Set the IsHitTestVisible of your top layer to false. I feel I need to type more text here but there really isn't much more to say.
It's not clear from your question if you need both the shape and the icon to get the mouse event.
If all you need is for the icon to get the event, then switch the order of your layers so Icon layer is on top.
If you need both shape and icon to get the event, then (if you keep your order with shapes on top) you would need to have some way to tell what icons a shape covers. Do you have a parent/child releationship between them? If not, can you create one? If you set up an event on the shape, and set up OnEvent handlers for the icons that listen to the events, then you can have the icons react as well.
If you are more clear about what your situation is, I could post some code that could help.

How to imitate zune panning control

I'm looking to imitate the following control, found in the zune software, in the quickplay tab. When you move the mouse from left to right the boxes new, pinned and history move to the opposite direction.
I'm thinking of applying a method to the mousemove handler which checks for the relative position of the cursor and then moves a grid containing panels accordingly but before I try to reinvent the wheel I'd like to ask around if there are people who have more experience with this, especially getting a fluid motion.
Please let me know
Do you mean something like this http://sachabarber.net/?p=829

Page navigation on left/right swipe

I'm trying to achieve swipe navigation on Windows Phone 7. I would like to navigate from one page to another by swiping left or right. How can i do this?
You might want to investigate the pivot control -- this is like a tab control where left and right swipes move between pages. Some of the labs on Channel 9 cover them (here, look at Exercise 2 for a walkthrough of creating one).
Look at the GestureService and GestureListener in the Silverlight for Windows Phone Toolkit
You can have a horizontal ScrollViewer which contains a horizontal StackPanel. Then put your pages in the StackPanel. Check out http://wp7iphone.codeplex.com for an example of how to emulate the iPhone-style horizontal swipe interface with this approach.
If you want the scrollviewer to "snap" to the nearest page when the swipe stops, it can handle the ManipulationCompleted event and manually adjust its HorizontalOffset appropriately.

Resources