Possible to change font size of iOS select input using Ionic - ios

I have a project I am working on in Ionic and the client has asked if the font size can be reduced on the select inputs.
This is a random picture from Google, but shows the select 'scroller' on iOS that I am referencing:
The blue, green and red options are what need smaller font size. I'm pretty sure that it can't be done, easier for me too.

You dont state which version of ionic you are using, so i will assume it is the latest version.
Each component in ionic has assigned sass variables which can be used to target the specific element of the component which can then be used to style it accordingly.
In your theme/variables.scss file you can target a variable which will then override the default style. In your case that would be the font size of the select. Now for this use case the font size is an inherited property and does not have a specific sass variable assigned to it ( you can view all the sass variables for the select here)
So in that case to override the default styles you have to explicitly wrap your scss code with
.ios,.md,.wp{
// your style here
}
From your image it looks like you are using the "action sheet select" style. which would target .action-sheet-ios .action-sheet-button class to change the font size.
.ios{
.action-sheet-ios .action-sheet-selected,
.action-sheet-ios .action-sheet-button{
font-size:1rem;
}
}
This targets ios specifically.

this can be done through css. first serve your app through the lab
ionic serve --lab
Than inspect element from chrome and select your text component and find its class. and Then you can add your custom CSS Styling.
Cheers :D

Related

Importing a custom font in Xcode

I am trying to incorporate a custom font in my app. I am using Nova Solid created by Billy Argel.
I imported the font and set it in info.plist. When I set a label to the Nova Solid font it shows up on storyboard as the correct font:
But when I run the app, the font displays as the default font:
Every other font I import works fine, not sure if it's something with these specific fonts by Argel or something I'm doing. I will appreciate some insight/help.
This is my info.plist
There's a chance that the font file isn't added as a target, try inspecting the file and making sure it is a target otherwise the font file won't be distributed with the app.
This is a common issue when the font works in IB but doesn't work in the simulator/on a device.

How to get iOS font size and set it to all labels of the app?

I want to make an app, where font size increase or decrease according to font size maintained in iOS in Settings. If you change font size of your iOS from settings, whatsapp font size displayed accordingly, I want same functionality.
The iOS functionality you're looking for is the Dynamic Type that only works for text with implemented text styles.
Basically, you must :
Use the text styles but beware, their availability depends on your iOS version.
Tick the adjustsFontForContentSizeCategory property (since iOS 10) in your interface builder or implement it in code so as to tell the system to handle automatically the Dynamic Type for the object it belongs to (text styles must be used of course).
Adapt all your constraints to the different sizes your app may encounter.
You can also follow the notifications related to the Dynamic Typeevents as indicated below :
Everything is well explained in this WWDC video detailed summary where all the contents and their video timelapses are indicated to reach rapidly the information.
There's also the possibility of adapting the graphical elements size as well with a Dynamic Type implementation.
All you have to do if to use Dynamic Type for your labels. This means not to set it explicitly but to use styles like Header 1 or caption. This styles are depends on user setting in Accessibility and will change automatically. https://www.raywenderlich.com/77092/text-kit-tutorial-swift
You can use system default sizes for Texts, like,
self.label.font = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline];
Please find documentation here.
For other components you can use like labelFontSize() and many more,
+ (CGFloat)labelFontSize;//Returns the standard font size used for labels.
+ (CGFloat)buttonFontSize;//Returns the standard font size used for buttons.
+ (CGFloat)smallSystemFontSize;//Returns the size of the standard small system font.
+ (CGFloat)systemFontSize;//Returns the size of the standard system font.

Display Telugu Text using local HTML file and web view IOS7

Hi i want to view Telugu font in my iPhone i have used the local HTML file to display the Telugu font so i have copied the some Telugu font using Google translator but its not showing. But i have seen some solutions for the Tamil font in this link in same is there any way to display Telugu font in the local HTML.
Its showing like this.
Thanks...
Before display any custom font that is not supported in iPhone, you need to add this font to ios.
You need to add your Font to yourApp-Info.plist. This answer will help you to do so.
You have to add custom fonts in your project before you use them.
This includes following steps:
Include your fonts in your XCode project
Make sure that they’re included in the target
Double check that your fonts are included as Resources in your bundle
Include your iOS custom fonts in your application plist
Find the name of the font
Use UIFont and specify the name of the font
Moreover refer to this answers on stackoverflow
iOS-Custom Font setting with Fonts specs

Where Can I Find Sprite Kit Available fonts?

I am experimenting with the new iOS 7 SpriteKit.
This line of code is taken from apple class reference and can be found in their sample project as well.
SKLabelNode *label = [SKLabelNode labelNodeWithFontNamed:#"Chalkduster"];
In this line the Chalkduster font is used.
I understand it's a bitmap font but how do I know what other font name I can use to replace Chalkduster?
You can also view the available fonts within Xcode itself by going to your storyboard file. You create a label there, go to the label's Attributes Inspector (the slider icon in the Utilities bar), select Font -> Custom, then scroll through the Family section to view the font list.
And here is how you would use a custom font of your own. Make sure you go through steps 1-5, then you should be able to use your custom font using [SKLabelNode labelNodeWithFontNamed:#"Font Name Here"].
Here is a list of iOS 7 installed fonts
I found that there is a very useful website showing all the available fonts on iOS. It’s iosfonts.com. The website shows how given font looks like, its name and its code name as well as the iOS version when specific font was added.
You can also log all the font names that are available as described here:
How to log names of all available fonts in iOS project.

iOS : Roboto Condensed through Interface builder

I have a weird issue here... An app uses some custom font (Roboto Condensed for instance).
I added my font to my project. They are associated with the target. They are declared in the info.plist and the typo is right (copy/paste from the original files) and they contain the extension of course. They are in the "Copy ressources" of the build phase, they are part of the Font Family when I log them but enumerating fonts, they work through IB, and they are not set when the app is running... The fonts were download from the latest version on the Google website.
Weirdest thing : I have other custom font, and they are working.
Even weirder : if I set the font programmatically, it works...
It seems that it is related to IB (font name, family?)
I'm running out of options here. Have you encountered this kind of behavior?
Thanks.
I did not find any solution. The only workaround is to have outlets for every font specific view and set it into code :-/

Resources