UITabBar Large Content Size Image (HUD) doesn't display in Large Text mode - ios

iOS 11 has an accessibility feature that shows a large version of a tabbar icon in a pop-up HUD when long pressed. In a WWDC presentation, it was mentioned this just involves turning on:
Settings -> General -> Accessibility -> Larger Text
..and adding:
tabBarItem.largeContentSizeImage = UIImage(named: "myHud")
Alternatively, you can add a vector image as the main tool-bar image, with 'Preserve Vector Data' checked in the asset catalog.
I've tried all combinations of this, and a long press does not show the HUD. I also tested with the Files app on my iPad running iOS 11b4 with no luck. This is the app that was demoed at WWDC.
Is there some other accessibility setting I'm missing to enable this feature? Or is it not available in beta 4?

It isn't enough to turn on Larger Text. You also have to use Larger Text — i.e. slide the slider way to right.
Then it works — well, the HUD appears. But the icon is not being enlarged within the HUD, so I don't quite see the point:
(As you can see, I'm doing this in a test project where I'm experimenting with the vector PDF image feature.)

This feature implementation and an example with tab bar are perfectly explained with illustrations on this accessibility site but here are the outlines :
Under Xcode, import the image to be enlarged with a pdf extension and a x1 resolution in the xcassets catalog.
In the new Image Set, tick Preserve Vector Data and specify Single Scale as Scales attribute.
If a storyboard is used for this image, tick Adjusts Image Size in the Image View section, otherwise put the adjustsImageSizeForAccessibilityContentSizeCategory image property to true in code.
For your tab bar or tool bar used in the application, first repeat the previous 3 steps for each image included in the items to be enlarged in the middle of the screen and then link the accessibility image to its appropriate item.
This feature is available only for the accessibility text sizes.
WARNING : don't forget to check your layout with these new images larger sizes.
For your record, an explanation of the Large Content Viewer is provided in this detailed WWDC video summary if need be ⟹ the UILargeContentViewerItem protocol is an iOS 13 new feature that shows the same HUD that's shown for standard bar items.

You need to go :
Settings > General > Accessibility > Larger Text(set on) > Move slider more then half to the right
Don't forget to set
tabBarItem.largeContentSizeImage = someKindOfImage
And Long press will does the trick.

Related

iOS: Launch image gets wrinkled in the center during a call/recording/hot-spot session

I use a set of launch images for my app and noticed that when I'm having a call, recording a voice note or sharing my Internet connection and put that activity in the background and launch my app, the launch screen is wrinkled in the center. Is there anything I can do to make the image look ok or is it just a standard iOS behavior?
Just define a key in plist file will solve your problem
Status bar is initially hidden = YES
OK, the solution I found is to hide status when launching the app, just like here
Seems like Apple "take" 4% of screen space from the middle of the screen (as far as I tested) to give it to status bar. Personally I faced this problem when using iPhone modem mode.
So if it is not critical for image to be centered vertically - the solution would be to place image above/below this "4% middle screen area".
Examples when image is cropped:
How image should look(image centered vertically & horizontally, width & height are fixed size)
How it actually looks
Example when image looks as supposed to (but not centered) :
Constraints example
Image with new constraints example

Using PDFs for icon images in Xcode 7.2

I'm attempting to use PDF files as icons in an app I'm working on. The issue I'm encountering is I'm getting inconsistent tint colors.
If I set a button image from interface builder, the icon image shows up black at runtime. Every time. Regardless of what I attempt to set from interface builder.
I tried setting my button icon image via code and instead of showing up black, it's white:
let myGraphicFile = UIImage(named: "myPDFImage")
let myButtonImage = myGraphicFile?.imageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate)
myButton.setImage(myButtonImage, forState: .Normal)
From code, regardless of what I attempt to set the tint to, it's always white from code.
I discovered this post relating to Xcode 6.x, but I think it might be dated, as I'm able to partially do it, but I can't set the tint.
Use PDF in XCode for an AppIcon (.appiconset collection)
I create the icons in Inkscape, save as PDF 1.5. I add the file to Images.xcassets. In Images.xcassets' attributes inspector, I'm setting:
Devices to Universal
Scale factor to Single Vector.
Summary: I can get it to show up and scale properly, but it's either black from interface builder or white from code. I suspect I'm missing something re: how to save the file from Inkscape.
Thank you for reading. If you have any suggestions, I welcome them.
I have figured out how to create vector icons with Inkscape. When you use PDFs to display icons in iOS, you need to alter the Attributes Inspector for your icon in xcAssets as follows:
1) Drag the PDF into xcAssets
2) Set devices (I did Universal and it worked fine)
3) If your PDF icon is under 1x, 2x, or 3x size class, drag it to Universal and delete the rest of them.
4) Set Scale Factors to Single Vector.
5) Render as Template Image.
Once it's configured there, then you just treat it was you would any other image in interface builder. It's essentially the same thing I was doing in code, but I don't think it gets done in code...it's gotta be done on xcAssets where the image lives. It's my understanding iOS renders vector images for the size class at run time. I think by attempting to tweak it in code wasn't working because the image had already been rendered.
If anyone has any questions on this, I found this link helpful in resolving my issue.
Additionally, this post covers the topic, too. https://stackoverflow.com/a/25804358/4475605

Use high definition tab bar icons programmatically?

I was wondering how I should go about using high definition tab bar icons if my tab bar icons are being set programmatically. I'm pretty much just doing the standard:
tabBarItem2.image = [UIImage imageNamed:#"ExploreIcon.png"];
Will putting two images in my supporting files named "ExploreIcon.png" at 30x30 pixels and "ExploreIcon#2x.png" work without using additional code? Thanks for the help!
You don't need to specify the retina version, the system will use the higher resolution version if present in the bundle. Also you don't need to add the extension
[UIImage imageNamed:#"ExploreIcon"];
the two images should have te same name for example :
ExploreIcon.png
ExploreIcon#2x.png
You need not consider choosing file which fits and displays better on a specified device, Let iOS do that for you.
Just keep files to support all possible devices.
Follow:
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
tabBarItem2.image = [UIImage imageNamed:#"ExploreIcon.png"];
This is good enough. Just make sure the file names are appropriate. i.e.
you have to add an imageview and set the cgrect size 40*40 and than you will add that image view on the tab bar icon image.

why storyboard ui elements not showing on UIViewController in xcode 6?

I am new to IOS development. I am developing an app for IOS 8 devices. I used storyboard for my design yesterday my storyboard showing all UI design but today morning it show blank UIViewController no UI element vision please see in screen shot and very strange thing is that when i run my app all ui element visible in my device. I google but dont find any solution please help me out. Thank you in advance.
It looks to me like you are using size class and you went into a particular size class and added these views. Now you are back in Any size class, so the views are not there (that is why they are greyed out in the document outline at the left). They are available only for that particular size class. If you switch back to it again, whatever it was, you will see them again. Basically, you have created conditional views - the condition being that they are present only when that particular size class situation is the case.
In other words, if you want your layout to apply in the general case, you want to start by creating and editing it under Any size classes. Only then do you switch to a particular size class and modify the layout for that particular size class.
when i run my app all ui element visible in my device
Yes, because on your device the particular size class situation matches the size class you were editing when you added those views. So there they are. That seems to me to prove my guess is right.
I have the same issue while copy a ViewController to another storyboard.
Fixed by following steps:
1: Select the viewController
2: Click on 5th Tab
3: Set the simulated size to Fixed.
Select install:
Since all components [like label,textfield,buttons] are in disable mode, one select Installed check mark its will be enable again adjust constrain accordingly.
The size must be the same, in all xcode storyboard
In my case, it was due to me setting alpha to 0.0 and forgetting it.

UISlider min and max image "Ringer and Alerts" in Settings -> Sound

I want the min and max images from the "Ringer and Alerts" slider in Settings->Sound. With the UIBarButtonItem, I can be set the "Identifier, so that an image appears for things like reply and add. On this bases, I can I do the same for UISlider to look like the one in "Ringers and Alert" either programmatically or through the Interface Builder?
You shouldn't ask these questions on SO, or better not at all. The good old way of taking a screenshot and then selecting and copying the icons you need works perfectly fine. For better results download the UIKit Extractor: https://github.com/0xced/UIKit-Artwork-Extractor

Resources