Customizing slider in WP7 - windows-phone-7

I have experienced some trouble with the Slider control on WP7. When I am dragging it, it will only drag a little bit, and then it goes back to where it started. If I let go of the slider quickly, then it goes a little further. E.g. if you want to drag it from the start to the end, you will have to quickly drag many times. What I want is a smooth slider, which follows my finger and stops until I release my finger, and it should stop where my finger is. Any way to get this the way I want?
I am also having a bit of trouble customizing it visually. How can I resize it and put it in the middle of the parent controller? Now, it puts itself in the top section, even though Vertical option is set to bottom..

How do you know where your finger are? Your finger is obviously going to be larger than the Slider itself.
The default slider is perfectly smooth. So all you're complaining about is the level of precision. You won't get 100% precision with a touch-interface that depends on the calibration of touch-input on your touch-screen.
Either you make the slider go in steps (which isn't smooth), or you accept the lower level of precision.

I finally solved the issue. The problem was that you can not(for some odd reason) have a slider and a gesturelistener at the same page. I removed the gesturelistener and the slider was smooth. I will not call that bad programming skills, this is definitely a bug, because the gesturelistener was on a totally different control in the page.

Related

Unity slider interaction with controller

So I have a laser pointer attached to my controller, shooting rays and triggering events whenever I press the tigger.
Tho it still has one or two buggs (Unity VR Controller UI Interaction), I have a more general question.
The UI needs some kind of slider. And I can't figure out how to make my pointer collide with the slider and behave in a slider-ish way. When I press my button, it currently ends up setting the slider to zero and not letting me drag it.
Thankful for any tipps on how to make them actually slide, since my ridgidbody-cube doesnt move and doesn't allow movement! Unitys documentation on e.g. the beginDragHandler isn't really helpful...
Cheers, Flo
If your enter/exit events already works, juste check the x (or the axis corresponding on your slider) of your "laser" every frame or so, and increase/decrease the value of the slider based on the delta between two check.
Hope it is clear, it should not be hard if you already have your events sets up !

Why can't whatever UIButton in the bottom left corner of the screen show its highlighted state?

Why can't whatever UIButton in the bottom left corner of the screen show its highlighted state?
I added another post a second ago while I was more confused about the issue and quickly got voted down. After more research, I have no clue what is causing this issue still...
The image on the left is what I want to be working, and the one on the right is the closest I have gotten to placing the images in the right spots while they still highlight.
As you can see, I have the buttons all aligned closer than the margin to the edge of the screen at 0 points away. All of the buttons correctly show their highlighted state when pressed except for the one on the bottom left. I have placed them inside a stack view, and tried multiple constraint layouts while shuffling the buttons around. Whichever button is on the bottom left won't highlight.
When I say highlight, the 2nd button in the image is highlighted. There is no UIViewController subclass attached to this storyboard view controller. Only the default state has any imagery attached to it (this is all that is normally required to get the darker highlight version automatically), and each button has both a background image and a main image.
After hurting my brain trying to figure out what was causing the issue I realized that I should have used more troubleshooting techniques before jumping to conclusions.
On my device the bottom left corner of the screen is barely touchable. The phone has had avid use being tested on by myself, and apparently the edges of the screen become less sensitive, especially with a screen protector on.
What I should have done...
Test the bug out in a brand new project to ensure that I am aware of the conditions causing the problem.
Test the project on a different device or simulator.
After doing both of those, I was guarenteed to find my solution to a bug that was very different than I am used to finding, and I will try my best to always use these techniques on future bugs before bothering all of stack overflow with a problem that they will never be able to diagnose.
Using the simulator revealed that my phone was having issues, and I will replace my phone in a couple weeks while continuing to work on my projects in the mean time!

Xcode Storyboard Zoom Magnification

I'm currently using the storyboard feature to position views. Due to the nature of these views, they need to be positioned with precision.
I'd like to view the Storyboard Scene/View in a magnification/zoom level greater than 100%, but it doesn't seem to be possible using the standard zoom in/out feature.
Is it possible to do this?
Note - I understand how to use the 'Size Inspector'.
It doesn't look like there is a way to do this, but there is at least one alternative that works fairly well:
Go to System Preferences > Accessibility > Zoom
Turn on the keyboard shortcut or scroll gesture
You should now be able to zoom in on any part of the operating system, including storyboards.
To make editing even easier, enable these options, some of which are found under More Options...:
Turn off Smooth images
Change Zoom Style to Picture-in-picture
Window Position: Follow mouse cursor
Cursor style: Crosshair
Enable temporary zoom
No, I am almost positive it is not possible to do this. You are stuck with 100% zoom. However, if you need great precision, you could try selecting the element you wish to move and use the arrow-keys to move the item around accurately.
However, like MacN00b, I do not use Storyboards a lot, so perhaps there is some top-super-secret setting buried somewhere.
This is one of the reasons I don't use storyboard but prefer good old fashion individual xibs. I don't think it is possible to zoom in past 100%, you may try double clicking on the background, I know that normally zooms in.

handling issue with listbox in a pivot

I'm working on a app in which I used a listbox inside a pivot control just like the outlook app does. The problem is sometimes when I scroll the list, a swipe gesture is triggered and it goes to another pivot item. This is very annoying, and it seems doesn't happen to the outlook app. Am I doing something wrong? How do I fix it? Thanks a lot.
If you're just using the default controls in the default way then you're not doing anything wrong in your code.
You haven't said if you're getting this on the emualtor or on an actual device. I find I sometimes do this on the emulator if holding the mouse at a slight angle or on an actual device if holding that in a funny way (such as when lying down).
Whether you scroll the listbox or the pivot will depend on whether your finger (or mouse-if using the emulator on a non touch-screen PC) first moves vertically or horizontally after first touching the screen. In my experience the scenarios described above can lead to this not always working as expected but I've never seen an issue with this on a real device being held in one hand and scrolled using a thumb.

Magic Mouse Momentum Scrolling Not Working

Unfortunately this is hard for me to test myself because I have yet to get a Magic Mouse of my own, but I've been told by my testers who do have a magic mouse that momentum scrolling isn't working in my app. I've not subclassed NSScrollView, but scrollview's document view is all custom. I have not overridden scrollWheel: anywhere, either, and yet momentum apparently just isn't working. I'm not even sure where to begin. I thought it'd just send scrollWheel events and things would take care of themselves. (Scrolling with a wheel or on the MBP trackpad works as expected.) Obviously I must somehow be doing something that's stopping it, but I don't even know where to begin. Thoughts?
I figured this out awhile ago and the problem was that on scroll, I was doing a lot of fancy view manipulation somewhat like how on the iPhone the UITableView adds and removes views as they scroll on and off screen. This worked great for performance - but the more I got into OSX programming, the more I realized this was wrong for OSX (but the right idea of iPhone).
Anyway, what's really going on, it seems, is that when you do something like a wheel scroll, the scroll event is sent to the view that's under the mouse cursor and then it ripples down the responders/views until it gets somewhere that handles it. Normally this isn't a problem, but with momentum scrolling the OS is really just sending ever smaller scrollWheel events to the view that was under the cursor at the time the momentum started. That means if the view is removed during the course of scrolling (because it scrolls off screen or something), it breaks the chain and the momentum stops because the view that's still getting the scrollWheel messages is no longer in the view hierarchy.
The "simple" fix is to not remove the view that got the last scrollWheel event - even if it's off screen. The better fix (and the one I went with) is to not try to use NSViews like they are UIViews and instead just draw the content using drawRect. :) Not only is that about a billion times faster, it Just Works(tm) with momentum scrolling because it's how OSX expects things to be done.
Repeat after me: OSX is not iPhoneOS.. :P
Odd scrolling behavior can occur when you don't set the Line Scroll and Page Scroll properties of the NSScrollView itself.
Beyond that, you're quite simply going to have to get a Magic Mouse - easily said or not :-) - to test this yourself or post the entire code of your custom view as well as the xib containing it. There's no way others can offer you more than guesses (like the above) without it.

Resources