How can I control the color of the text used in a magnify window? - cocoa-touch

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.

Related

iOS / Titanium: Clear Button cannot be seen on a TextField with a black background

I want to add the clear button on the TextField like so:
<TextField clearButtonMode-"Titanium.UI.INPUT_BUTTONMODE_ALWAYS" backgroundColor="black"/>
The clear button usually looks like this:
However the issue is that the background of the TextInput is black. This means the clear button cannot be seen.
How can I change the appearance or colour of the clear button so this is not an issue?
I know that it should work but if its an ti sdk issue then you should try to test it with other ti sdks.
If you find same issue then you can file a JIRA issue with test app and then you can use rightButton property to achieve what you want.
http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TextField-property-rightButton
To be completely honest man. you could just add a view inside the textField. I think its bit more efficient anyways and if you code by percentages as long as your border radius is more then half the height it will be circle.

NSPopover color invert in Yosemite dark color

I'm using NSPopover, and when I change the system dock color to dark (Yosemite new feature) some elements in my view invert their color.
For example some labels changes from black to grey, or text fields background changes from white to black. And if I have a view with white background it is now changes to the blurred dark effect.
So two questions:
Can I cancel this behaviour and force the UI to act like in regular mode?
Is there any rules here which element invert their color?
Because it seems that some element changes and some not.
This is my app in Yosemite regular mode:
And this is in Yosemite dark mode:
It might be a library you're using that's causing this behavior. I just tested on a new project and I couldn't make the NSPopover black no matter how hard I tried.
What libraries are you using ? How did you set up your NSPopover ?
Maybe you could try changing the appearance property of the view ?
view.appearance = [NSAppearance appearanceNamed:NSAppearanceNameAqua];
NSView has the property appearance because it conforms to NSAppearanceCustomization.
Also see NSAppearance.
————————————————————————
Found the solution:
self.popover.appearance = [NSAppearance appearanceNamed:NSAppearanceNameAqua];
the result:
There are ways to do this, though I would recommend embracing it.
It's not concretely documented what will change and how.
But observation will show you what to do.
Primarily it requires you do the opposite of opting in.
Opting in is using Appkit interface elements as is as well as using the NSColor names provided as system colors and using the NSVisualEffectView.
That means to explicitly opt out you need to go around and basically customize views and that mostly means setting explicit colors and occasionally subclassing.
Out of the box HUD style popovers and panels would be opting in.

Background color of a Gtk.TextView - can't see selection

I successfully changed the background color of a Gtk.TextView (GTK3) with method override_background_color:
color.parse(self.settings.get_string("bgcolor"))
self.ui.NoteView.override_background_color(Gtk.StateType.NORMAL,color)
I also override the foreground color.
Unfortunatelly in that case making a selection in the text is invisible.
How can I modify the background and foreground color of a TextView without loosing the visible text selecting?
It's best to format the text in a GtkTextView by using GtkTextTags. You can apply any sort of text formatting(background & foreground colors, font, size, weight, etc..) to any portion of the text.
Click here for an example.
Hope that helps!
By the way, what you're doing is changing the style of your TextView. In Gtk it's best to stay away from doing this, especially if you aren't in a controlled environment or plan on releasing your software for others to use, because gtk's philosophy is to leave the styling and theming up to the end user for their own personal touches/needs.
This is why you are getting some unwanted results by overriding style colors.
In terms of a GtkTextView it does however offer simple formatting of the text(even support for adding images/widgets) via use of GtkTextTags as the link shows above.

Chaning the background color around a PDF in a UIWebView on Device

I'm using a webview to display a PDF.
The webview displays the PDF at it's actual size which is a little smaller than the size of the webvieww itself, revealing the scroll view underneath it.
I've tried setting the Webview to opaque and setting it's background color to another color, which works fine and dandy in the simulator, but fails to change the color on the device. On the device it changes the color of the background of the view behind the scroll view, this can be seen when the PDF is pulled all the way down.
I've also tried setting all the UIView's backgrounds, by iterating through the subviews but to no avail.
I've updated a diagram to help illustrate which area I'd like to color.
Uploaded Diagram
You really shouldn't mess around with UIWebView's internals.
They can change anytime and your code might just crash on the next version of iOS.
If you need more control about pdf display, you might wanna take a look at other possibilities to show pdf, like using the CGPDFDrawPage* functions. Of course they are pretty low-level and it's a lot of work required until you can get fast page display, zooming, etc all right.

Tips on implementing a custom UITextView interface on the iPhone?

I am trying to implement a control to edit text that will display the text in multiple colors. None of the solutions I have attempted yet have been good enough.
UITextView cannot accomplish this. All of the text must be the same color.
Using CoreGraphics to draw the text does not allow the text to be selected.
Using a UIWebView, DIV and PRE tags cannot be set to contentEditable on Mobile Safari.
Currently playing with using an off-screen TEXTAREA and an on-screen DIV to show the rendered text. This works pretty well, except supporting all of these at the same time seems impossible: click-to-type, click-to-move-cursor, click-and-hold-select/copy/paste.
Anyone have any tips on this predicament?
I've been trying to find any preexisting library out there that will accomplish this in a good way, to no luck. I'm open to any ideas!
Well, just pulling an idea out of my... let's say hat.
Could you put a transparent UITextfield over a view that draws the text? If the background was clear and the text color was clear the user could not perceive it but it should still respond to all commands. As the user enters and edits text you could draw the results on the view underneath.
I think the selection would work without any modification at all. When the user selected the clear text, it should create the illusion of selecting the drawn text automatically.
Like this one? StyledText http://three20.info/gfx/overview/styledtext.png It's in Three20 .
Here is an idea. I have no idea if it would work.
If you are only using colors, and not styles, the a UIWebView with colored text might layout text in exactly the same way as a UITextView. You could put a UITextView with invisible ink (text and background fully transparent) over a UIWebView and mirror the contents with colors in the html. I assume you can do scrolling with javascript along with the colored layout.