iOS7 issue with UISearchBar placeholder text alighment - ios

Hi it's strange behavior in UISearchBar placeholder text alignment while that UISearchbar non-edit mode but that disply fine at editing mode.In non-Edit mode that placeholder text position not displying as center, that text display bit up-side in to UISearchbar like bellow screenshot.
Non-Editing Mode placeholder Looks like:
Editing Mode placeholder Looks like:
As you can see First screenshot that text display bit up-side not look's like second screenshot Center. So i want to make this place Holder text center as search icon Y position.
I just setting search Bar Placeholder text using basic way:
[self.srcbar setPlaceholder:#"Please Enter search Text"];
Please help me in this how can i fix this issue.

What you have described, is technically the default behavior for the search bar. If you'd like to get the text to slide over a bit when editing, you can adjust, in Interface Builder, the offset of the search bar. I've included a screen shot of xcode and the simulator to show you the difference at run time. See the image here: .

Related

How to center text in navigation title view

I'm trying to have my navigation bar with left and right button (SF Symbols) and title aligned so it looks better visually but text in title view seems to have either some spacing or top alignment there and it makes title look higher which is not what i want. How to make text centered there?
EDIT: Seems it happens when using custom fonts, when i tried system fonts and other custom fonts some of them are displayed correctly
EDIT2: After further investigation it turned out to be the font issue, the one i used is designed not centered, which can be seen even when choosing font from dropdown menu, its not centered in selection either
It's not necessary answer specifically for question in the topic but it is answer for my issue.
It turned out that my problem was caused by custom font which has space below by design. So what i did in the end is to lower navigation title by using this line:
navigationController?.navigationBar.setTitleVerticalPositionAdjustment(CGFloat(5), for: UIBarMetrics.default)

Bold Text accessibility option hides UIButtonBarItem graphics

This is a follow-up to a question I asked last week here. The main screen of my app has two button bars. Each of the buttons has either an image or a text label. I've determined that when the user has the Bold Text Accessibility option enabled, the image buttons disappear from the screen. The buttons are functional -- tapping where the button should appear has the desired effect, so the button is effectively present but invisible. The text-based buttons appear and function normally.
Is this expected behavior, or is this a bug in the iOS implementation? If it's a bug, is there a procedure to report it? Is there a workaround? My fallback solution is to display a warning based on UIAccessibilityIsBoldTextEnabled(), but I would like to do better.
I have just had the issue reported to me by one of my customers. I can replicate the issue on iOS12 however Apple appear to have fixed it in iOS13.
My workaround for iOS12 is to set the tintColor of the toolbar:
[toolbar setTintColor:[UIColor grayColor]];
With the tintColor set the toolbar buttons are visible with Bold Text on.

can I create a button with text and image together in Storyboard?

I put a UIButton in my storyboard. It looks simple:
its properties are also simple:
I wanted to include an image in this button, so that it looks as follows:
[image]text
but when I put the image name in storyboard:
the text disappears and all I see is:
how can I show both things together next to each other?
It's just a white title on white background.
You should see the title if you set Text Color back to blue or whatever you wish. For some reason it is different on the screenshots you provided.

is there an overdraw issue in ios

I have to create the following layout in iOS.
in android we could use a single EditText to create this.
But in iOS we need
An imageView for background
A text field for the text
An image view for search icon
In android this causes overdraw.
is there the same overdraw issue in iOS?
You can not do without following view combination
An imageView for background
A text field for the text
An imageView for search icon
best possible way is you can loop through the search bar subview and replace or modify the curent subview to create the custom search bar
and there is nothing like over draw because they are key component for drawing a view. if you need any specific clarification then let me know
Consider using UISearchBar.
Or UITextField with a border (set on its layer), placeholder text and a rightView (set to an image view) for the icon.

When setting UIToolBar as inputAccessoryView to UITextField hides the UIToolBar

I have tried one sample from the this link
Actually what i tried is placed an uitextfield and added that toolbar as inputaccessoryview.
When i tap on the uitexfield, it shows the uikeyboard with that toolbar added on top that is ok.
But the toolbar which was showing under the pickervieew is now get hidden after i did the above thing...
Please let me know why is that happening
If you mean your app had a toolbar at the bottom, and the picker view/keyboard/other input view appears on top of this, then this is the expected behaviour.
For example, look at mobile safari, when you enter text in a field on the page (like an SO answer, for example!), the keyboard covers the lower toolbar. Otherwise you'd hit it when typing.

Resources