i need your help. Look, I've got gameobject and on that gameobject is Unity script called "Scroll Rect". The Content of it is the 'Container', where are buttons. When i set the "Horizontal" value to false and then scroll up the container ( in the game), then the problem appears.
Can you help me please ?
Look at it
Problem
Related
I have a button under a canvas that is suppose to restart the scene. But instead its not calling the intended function of attached script.
On Unity Forums, I found solutions like it should be at higher hierarchy in canvas, and the canvas should have a graphic raycast and so-on.
But it still isn't working, although its on click array detects the intended method it is suppose to call.
Scene Editor with Canvas Selected:
Scene Editor with Button Selected:
Remove the canvas component from your button.
Make sure that there is a GraphicRaycaster on your canvas, and that there is an EventSystem object somewhere in the hierarchy.
(Both should have been added when you first added the canvas, but things get lost)
The screenshot that shows your button being selected, also shows, that you did pick a gameobject for the OnClick event, but you didn't pick a function from the drop down right next to that field, it says no function.
Instead of selecting the C# class, select the GameObject that
btnSceneSelect is attached to.
If btnSceneSelect is not attached to a GameObject, attach it to one
(other than the button).
Taken from this site
All I have an UIImage in an UIView and I have added an UISwipeGestureRecogniser in both IB and in code. Code is like this :
EventImage.addGestureRecognizer(swipeRec)
EventImage.userInteractionEnabled = true
swipeRec.addTarget(self, action: "swipedView")
It will read a 'right' swipe fine, but I want to control a down swipe.
The UImage is in an View and the View is a part of a scrollview. So I have switched off DirectionLock and Bounces. So the UIView cannot be pushed down from the NAV BAR. And it still doesn't recognise a swipe down.
Any ideas ?
In IB I have created the recogniser by dragging an 'Swipe Gesture Recogniser' on to the image I want to be able to use the gesture.
Then if i select the 'Gesture in IB' I can set which way the gesture goes, and I select down like this :
Then I set an func in swift and it does not recogise down but when I change it to right i works fine.. I have checked the idea by using breakpoints and the breakpoint triggers on Right swipe (and left) but going down doesn't work.
I think it could be because I am in a scroll view.
I have added :
func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
As I thought this may help.
Hope this is clearer.
A UISwipeGestureRecognizer can only recognise swipes in one direction.
That direction is set in the direction property of it.
If you want to swipe right or down then you will need two gesture recognisers. One for the right swipe and one for the down swipe.
recognizer.direction = UISwipeGestureRecognizerDirection.Down
Also, it help to read the documentation. All of this info is directly from there.
How do I create a Yosemite Reminders/Notes/Messages/Contacts style window? Specifically, the traffic lights are on the left pane of a split view, while the right pane takes up the whole space including the title bar area. See the attached screenshots.
This is a combination of two new NSWindow options.
Include NSFullSizeContentViewWindowMask in your window's styleMask to make the content view of the window stretch up behind the title/toolbar.
Enable the titlebarAppearsTransparent property to disable rendering of the translucent title/toolbar material so that the content view shows up in the title/toolbar area without getting blurred.
How do you change the width of a button in a tool bar on Mac? I can change the width in interface builder but it only updates if the width is larger than the current size. If I try to make it smaller it doesn't change in tool bar.
Not sure if you found an answer yet, but I was recently looking to do this as well for a popup button. The answer is to create the button outside the toolbar first. Then once you create it you can drag it onto the toolbar area and it will be added as a toolbar item.
For example, I created a popup button on my main window and set it to the width that I wanted. Then I opened the toolbar section and dragged that button onto it... and it worked.
Good luck.
I have a typical cocoa application. There is a toolbar item on the toolbar, current behaviour is to draw a rectangle in the view of main window whenever this toolbar item is clicked.
However, now there is a new requirement: user needs to be able to drag this toolbar item to a position in the main view so that the rectangle will be drawn on that position (where user release the mouse to drop the toolbar item).
I checked the apple dev document at https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSToolbarItem_Class/Reference/Reference.html and https://developer.apple.com/library/mac/documentation/cocoa/Conceptual/Toolbars/Toolbars.html#//apple_ref/doc/uid/10000109i , but cannot find any method related to this.
Could anyone know how to do it? Thanks.