I have a Scroll View in my Mac app with a white background but I want the background to be completely transparent. I changed the opacity of the background to 0 but that doesn't seem to help, so I added an image of my settings and i was hoping you maybe were able to see the problem
Thank you in advance!
is this for a 10.7 App? If so it should just work out of the box. If you are doing 10.6 or earlier you might have to implement your own custom scrollbar or use a toolkit like Chamelion,etc to get the effect you are looking for. Only 10.7 has overlay scrollbars by default, prior to this the OS scrollbars subtracted area from the content view to dedicate to scrollbars.
On iOS, you just set the background to the clearColor. It seems logical the same would apply to the Mac.
Related
I have a mac application with the views built in a storyboard, targeted at 10.13.
In all OS's above 10.13 all appears fine, however in 10.13 all of the buttons disappear. Buttons are Style Square, type Switch, bordered is on, transparent is on and I have both an Image and Alternate image selected.
Not sure what could be causing this and I don't have a machine running 10.13 to test on. Any ideas?
Thanks
Solution A: Switch off Bordered and Transparent, like the default check box in IB. A transparent button never draws itself (according to the documentation).
Solution B: Switch on the layer of the button or one of its superviews in the View Effects Inspector. From 10.14 the button has a layer by default.
Both solutions have the side effect that the title is also drawn, even if the image position is Image only. Remove the title as a workaround.
In Xcode my UIButton is centered and locked in the right place using the grids but when I run the app I'm building from a tutorial I'm following the button is slightly to the right.
Is there a quick fix for this other than shifting the button to the left in Xcode until it's centered in simulator which is pointless because the guides in Xcode are there to help so I'd like to take advantage of them and not need to do this.
Make sure you have unchecked the use Autolayout option for your Xib.
if is horizontal centered image, try like this:
ps: make sure that the parent view of the UIButton is also centered in the screen
After updating XCode I realised the issue was that XCode was launching ios simulator for 3.5inch iphone. I changed the device to iphone 4inch retina and this fixed the issue.
I'm adapting my app to iphone 5 and I've got a problem. I saw all documentation regarding this and it didn't work yet.
I put the Default-568h#2x.png and everything resized successfully.
The problem is in the touch stuff. I've got a toolbar on the bottom and when I touch it nothing happens :( in the retina 4" simulator. Works fine in retina 3.5
In retina 4", if I set the toolbar in the inspector above 439 px in the Y position works fine. Anything below this makes my toolbar not to work.
As I said, I tried many many things unsuccessfully.
I'm using Xcode 4.6.1, I've got a Main View (not having a Window option in the Attributes inspector).
Thanks in advance.
Your window or the main view is not resizing correctly. Make sure you have set them up such that they autoresize in both directions. Try to set different background colors to your views to find the view that is not resizing correctly.
Ensure that all of your views are auto-resizing correctly to fill the screen. It sounds like the main container view you have isn't being resized and is drawing the toolbar outside of its frame. This will work from a visual point of view as UIView - clipsToBounds defaults to NO, but touches won't work outside the frame.
I'm trying to make and iOS app with both portrait and landscape views, but if I open it and change the orientation to Landscape, some buttons got offscreen, after going to IB and reordering the buttons, in Portrait they go off screen.
After googling, I dont have ANY ideia how to 'change' views according to orientation.
Could you guys give me some help?
Ah, also, Apple Support Documents seems pretty useless to me :P
Thanks!
There a method - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{}
which is useful in such cases.
You should change autosizing properties in IB (they're in the same place where frame size is) or change autoresizingMask properties of your inner views and controls programmatically. This controls what happens to the elements of your screen after it gets resized (for example when the screen is rotating). You can glue your components to left or right or both, top or bottom or both and similar. Play with it, it's pretty powerful and you don't need any code for that if what they can do is enough.
My (cocoa) application has an usability problem with Lion (OS X 10.7). There is a scrollable component that has a dark background, so it is hard to see the default transparent dark scrollbar.
Is there a way to replace the appearance of the scrollbars with a lighter (white) one? Safari and other browsers seem to do this dynamically based on the websites backgrounds, but I have found no easy solution for a native cocoa application. Is there a solution that do not involve subclassing NSScrollView?
[myScrollView setScrollerKnobStyle:NSScrollerKnobStyleLight];
From the NSScrollView Class Reference.
If your window is created in IB, you can change the scroller style in the Attributes inspector.