I have an UITableView in my application, which is in an UIView that has it's background colour to the Scroll View Texture thing. This is all in an UIViewController. It works all nicely and stuff, but I get these fugly black corners around my table view edges:
The Background colour of the table view is set to the clear colour, and those squares even appear in Interface Builder. Any ideas on how to eradicate these evil UI blemishes? They make my UI look like something that was thrown together in 3 minutes, even when I spent more than a week designing my entire UI. It makes me want to punch UITableView in the face, too.
Quite strangely, setting the background to clear in code seemed to solve it for me. It is a really weird issue, and I submitteda bug report to Apple about this, although their bug reporter needs it's own bug reporter.
Also make sure the background color is not just clear color, but that opaque is NO.
Related
I have an NSView with white text against a black background. The view animates slowly up and down (+/- 10 pixels every 1.5 seconds), and the text visibly flickers while animating. It doesn't flicker a lot, but enough that it's noticeable when trying to read it. I've tried animating both with NSAnimationContext and CABasicAnimation.
This doesn't happen with the exact same design/animation on iOS, just on OSX. It might have something to do with the screen refresh rate, but it's driving me nuts and I figured I'd ask in case there was a simple solution.
The effect you describe is even more pronounced if you animate diagonally. I thought it might be diminished if one turned on shouldRasterize, but it's not. It feels as if it is to be an anti-aliasing of the narrow strokes of the font as the image animates through non-integer positions during the animation. The effect is curiously diminished if you use bold fonts. Also, the problem appears to be unrelated to the NSTextField, because if I take an snapshot of the NSTextField, remove the text field, and animate an NSImageView, the flickering is still apparent.
Bottom line, the effect is diminished with bold fonts. It feels like there should be an anti-alias feature one could turn off, but it's escaping me at this point.
I just happened to start using Facebook's Pop Animation framework in my project, and when I implemented a POPBasicAnimation for this animation the flickering seems to have disappeared completely - even for non-bold text.
I am creating an app for practice that is a simple drawing app. The user drags his/her finger along the screen and it colors in a 100px x 100px square.
I currently achieve this by creating a new colored UIView where the user taps, and that is working. But, after a little time coloring in, there is substantial lag, which I believe is down to there being too many UIViews as a subview of the main view.
How can I, and others who similarly create UIViews on dragging a finger reduce the lag to none at all, no matter how many UIViews there are. I also think that perhaps this is an impossible task, so how else can someone like me color a cube of the size stated above in the main view on a finger dragged along the screen?
I know that this may seem like a specific question, but I believe that it could help others understand how to reduce lag if there are a very large amount of UIViews where a less performance reducing option is available.
One approach is to draw each square into an image and display that image, rather than keeping around an UIView for each square.
If your drawing is simple enough, though, you can use OpenGL to do this, which is much faster. You should look at Apple's GL Paint Sample Code which shows how to do this in OpenGL.
If your drawing is too complex for OpenGL, you could create, for example, a CGBitmapContext, and draw each square into that context when the user drags their finger. Whenever you draw a new square into that bitmap, you can turn the bitmap into an image (via CGBitmapConxtextCreateImage) and display that image an a UIImageView.
There are two things that come to my mind:
1- Use Instruments tool to check if you are leaking any memory
2- If you are just coloring the views than instead of creating images for each of them, either set the background color property of UIView or override the drawRect method to do custom drawing
I think what you are looking for is the drawRect: method of UIView. You could create your custom UIView (you propably have that already) and override the drawRect method and do your drawing there! You will have to save your drawings in an array or another container and call the setNeedsDisplay method whenever the array content is changed.
I'm drawing some custom shapes behind a textview to make it appear it's a notepad. It draws a repeating bitmap across the top, as well as a white background under the text, and a secondary "note" page under the rest to add a little dimension and layering. See the screenshot:
Now, this is with setDrawingCacheEnabled(true) for the TextView this drawable is applied to. With this method call applied, the scrolling is VERY smooth, exactly what I want. Without it, the black background disappears, but the scrolling is very choppy. Any idea on how to cache this view so that scrolling is smooth without destroying my UI?
Seems this function only works with solid colors, as defined in the documentation which I should have read before posting. I find it hard to believe there's nothing that caches complex views and drawables to work as well as that function does, but, whatevs. Live 'n learn.
If you can edit the title and make it shorter, good on ya. Which is to say, sorry for the title length :P
In the HIG:
http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Controls/Controls.html
Scroll down to the section "Window Frame Controls". Buttons with NSTexturedRoundedBezelStyle draw differently when placed in an NSToolBar (darker gradient).
Putting HIG questions aside, I need the darker bezel for a button that is not in the window frame. It seems there is some flag which I am missing.
I can obviously just draw it myself, but wanted to check if there's just something totally obvious I am missing here?
Kind regards,
Alec
As of Lion, the Round Textured button is translucent, which means that some of the background shows through it. That's why it looks different in the toolbar, because there's a darker background behind it.
There is no magic flag to change this behaviour, the only way to give it a darker appearance would be to place it on a darker background.
We are using a UITextView with a dark background. As such we have made the text white color in order to be easier to read. The problem is the magnify window that pops up when you hold down your finger to move the insertion point uses white for the text color as well. This makes it impossible to see exactly where the insertion point is.
Is it possible to independently control the text color used in the magnify window?
Here is a screen shot illustrating the problem.
I just did a quick test in here and it's working fine.
I tested with firmware 2.2.1, in the simulator and using a device.
This is what I did to test it:
1- Created a new View-Based project
2- edited the nib in the Interface Builder, added a UITextView, setting the text to white and the background to gray, leaving everything else default
Do you have something different?
Hmm, it works correctly in the Notes app. Not only is the background yellow, you also see the lines.
Maybe it depends on whether you set the background color directly on the UITextView or make it transparent and set the background color of its containing view?
I don't think you have any control over that. And I think you should file a bug report with Apple over that. It should be smarter than that.