Ways to adjust font sizes for different devices in Main storyboard for iOS development

Is there a way to adjust font size based on different devices? The current UI is optimized for iPhone 8, with a font size of 14. However, this causes some letters to not be visible on smaller screens of other phones. How can I solve this issue?

Main.storyboard

<= I attempted to find a solution on this website but it did not help me address the problem.

Answer №1

To adjust font size based on screen size, you won't be able to do it using storyboard. Instead, you'll need to implement code that checks the device type and screen bounds. Here's an example:

UPDATE: You can try something similar to this

let screenWidth = UIScreen.main.bounds.size.width
if screenWidth == 640 {
   // iPhone 4inch and 3.5inch. Smaller than iPhone 8
   // Call change font
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

When the button is clicked, a modal will pop up

Looking for help in incorporating JavaScript to create a responsive modal that pops up with lyrics when a button is pressed in a table. Any assistance would be greatly appreciated. Note: Only the code for the table has been provided. Let me know if you&ap ...

Using CSS to style HTML elements with spaces

Apologies if this question can easily be answered with a Google search, but I am having trouble finding the right keywords to use. While I have a decent grasp of CSS, I feel like there is still much more potential to explore and improve my code efficiency. ...

I'm looking to optimize my paragraph for small screens by incorporating a Google AdSense banner

I need help adjusting my content with a Google banner for small screens. Here is an example image: Example Image Within the parent div with the class name parent-content, there is a banner div named ad3. Below is the code I have written for screens with ...

Styling a fixed sidebar in Vue.js

I am currently working on a layout design that includes a fixed sidebar on the left side, positioned beside a container with its own grid structure. Utilizing Vue.js means each template contains <div> elements where I attempt to incorporate additiona ...

What steps are involved in setting up a dropdown side navbar?

Is there a way to automatically activate the next dropdown in the side navbar when I click on the 'Next' button? And similarly, can we open the previous dropdown in the side navbar when clicking the 'Previous' button? ...

The Bootstrap column class is malfunctioning

Recently, I've been diving into the world of web development. I attempted to create three divs in one row using Bootstrap col class, but unfortunately it didn't turn out as expected. Two divs ended up in a row with some blank space, while the thi ...

Disabling the Toolbar in iOS Progressive Web Apps (PWAs

Recently, I developed a basic Angular PWA and added it to my iPhone's Homescreen. In order to eliminate the Safari Toolbar, I made sure to include this code in my index.html: <meta name="apple-mobile-web-app-capable" content="yes"> After imple ...

Experiencing difficulty adjusting the width of a Tumblr post with JavaScript or jQuery?

Calling all coding experts! I've been working on customizing a Tumblr theme, and everything is looking good except for one issue. I'm struggling to adjust the width of photos on a permalink (post) page. Check out this link: You'll notice t ...

Problem with using Jquery DIY slider for multiple purposes

There seems to be an issue with the DIY Slider that I'm using. Whenever I attempt to use this slider more than once on a single page, the second one fails to function. I have exhausted all possible solutions that come to mind. $(".slider").diyslider ...

Can the navigation arrows be placed adjacent to the swiper container instead?

Has anyone successfully implemented swiper navigation arrows similar to the ones shown in this image? If so, could you please share how it was achieved? Here is an example for reference: I attempted to create stylized blocks and assign them as the origina ...

Transferring images from one View Controller to another

My journey with XCode and programming is just beginning, and my grasp of the English language is not yet perfect. Currently, I have two view controllers named L1ViewController and ImageViewController. Within L1ViewController, I have multiple buttons with i ...

To access the dropdown submenu on the Bootstrap nav bar via mobile, a prolonged tap is required rather than a single tap for it to work properly

Hey there, need your help with something interesting! If you head over to and look at the third link in the nav bar, you'll see a dropdown with a submenu. Everything works smoothly on a PC - just hover your mouse and it opens up. But when you try it ...

Resolving odd SVG anomalies

I recently exported three SVGs from Sketch to include in HTML, but one of them (specifically the Twitter icon) is presenting a mystery with its appearance. All three SVGs were created in the same manner, using #999999 as the stroke color and having a stro ...

Seeking assistance with setting up an array for extracting plist data in Swift 3

After the recent transition from Swift 2 to Swift 3, I find myself struggling to resolve a coding issue on Xcode. The problem lies in my attempt to add building pins using the following code: func addBuildingPins(){ let filePath = Bundle.main.path(fo ...

Position the list-group to the right using a float

I am new to Bootstrap and I'm facing a challenge with arranging my list items. I have 15 items in total, and I want the last 7 items to be aligned on the right side (see the image for reference). Despite trying out various tutorials, I haven't be ...

The design template is failing to be implemented on my personal server utilizing node.js

I've encountered an issue while developing the signup page on my local server using Bootstrap 4. The CSS is not getting applied properly when I run it locally, although it displays correctly in the browser. Can someone explain why this is happening? ...

How to send an image to an HTTP server in Objective C

When sending an image to a server using HTTP, the following code is used: -(NSDictionary*)sendImage:(UIImage*)image withDescription:(NSString*)description andTarget:(NSString*)target andTargetId:(int)targetId { __block NSDictionary *result = nil; NSData * ...

Not all mobile browsers support centering, but regular browsers work flawlessly

For some reason, I am experiencing an issue with centering divs on mobile browsers. It works perfectly fine on normal PC browsers - no issues at all =D. However, the main content on mobile devices remains stuck to the left. I have tried multiple solutions ...

Implementing a Navigation Bar in Swift using a .xib file

Currently, I am diving into Swift 4 programming and facing a challenge with my project that involves MVC and XIB design files. The issue lies in adding a NavigationBar to a view, specifically the missing back button to the left of the title. Here is my de ...

how to dynamically add classes in jsx with a combination of tailwind and regular classes

Why is it that in Nextjs 14 (ReactJS 18), when I conditionally assign css classes within a jsx code like this: <Swiper className={lightbox ? "swiperLightbox h-[80%] md:h-[70vh] z-50" : "swiperMain h-[21vmax] rounded-xl"} > ...