Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
3 answers
329 views

Changing appearance right after changing app language on fly causing problem in iOS using swift

I have both options Appearance and change Language (to Arabic) in my iOS app. When you change language and try to change appearance, some UI elements restores their direction i.e RTL to LTR I'm doing ...
Muhammad Awais Jamil's user avatar
-1 votes
1 answer
58 views

How to Change Keyboard Return key type in UISearchBar

I would like to change the string title of the return key of a keyboard invoked by a searchBar in my iOS App. I want to change the title from "Search" to "Done". My searchBar is ...
BlueskyMed's user avatar
  • 1,277
0 votes
2 answers
828 views

how to remove shawdow of navigation bar in ios?

I want to remove that line and shadow type bar in navigation bar func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: ...
heli bhadeshiya's user avatar
0 votes
2 answers
478 views

UITabBarController Appearance Only Allows Me to Set It Once

Here's the issue: I have an extension that I've written to allow simple customization of the Tab Bar in a standard UIKit app. The issue is that it works fine -once. Subsequent attempts to change the ...
Chris Marshall's user avatar
-1 votes
1 answer
205 views

How to add gradient color to UIView using Custom Class and UIAppearnace() in swift

Hello Everyone I want to add Gradient Background Color to UIView using UIAppearnce() with CustomView Class.I am facing an error - Thread 1: " Illegal axis type, @, for appearance setter, ...
Shubham Saini's user avatar
5 votes
1 answer
2k views

Setting a UITabBarAppearance breaks UITabBarItem appearance proxy font size when selecting tabs

The following, which sets the title text appearance proxy to use a big font, works as expected, and the UITabBarItems retain their big font when you select them: func application(_ application: ...
Jon Cox's user avatar
  • 10.9k
0 votes
2 answers
61 views

Why does UIButton Label ingnores appearance setting when contained in UITableView tableHeaderView?

I have created a simple UIViewController which contains a UITableView. When adding a tableHeaderView which includes a UIButton it seems not to be possible to change the button label using appearance ...
Andrei Herford's user avatar
1 vote
0 answers
439 views

UITabBar items title issue, when the title is long and using UITabBarAppearance

Because of iOS 15’s scrollEdgeAppearance transparent problem, I have to use UITabBarAppearance to set my UITabBar. But when using UITabBarAppearance, if the title is long, it will overflow the item ...
Lucas's user avatar
  • 11
2 votes
0 answers
81 views

Detecting when UINavgiationBar appearance changes from standardAppearance to scrollEdgeAppearance

How to determine if the Navigation Controllers UINavigationBar changes the appearance between standardAppearance <-> scrollEdgeAppearance as the underlaying UISCrollView changes it's scroll ...
Peter Lapisu's user avatar
  • 20.9k
0 votes
0 answers
687 views

SwiftUI: Start/stop timer when View appears/disappears

I've got a view where I show a document (basically a background image with some emojis on it). There are multiple documents in my NavigationView and whenever I load a a document (DocumentView gets ...
Remo's user avatar
  • 1,392
3 votes
1 answer
3k views

iOS 15 UITabBarItem customization

I have UITabBarConroller subclass and custom items. Customization looks like this: private func updateTabBar() { guard let items = tabBar.items, tabViewControllers.count == items.count ...
Valentin Shamardin's user avatar
-2 votes
2 answers
1k views

UINavigationBar.appearance().isTranslucent not working

When I use this: UINavigationBar.appearance().backgroundColor = UIColor(named: "brown") I get a nav bar that has the correct brown and it is translucent. But I don't want it to be ...
Kenny Wyland's user avatar
  • 21.8k
0 votes
1 answer
133 views

Remove/handle UINavigationBar UIAppearence to fix issue in UIActivityViewController share screen title transparent after tapping more in Swift iOS

I've applied UINavigationBar.appearence() with use of class UIAppearence() throught out the app. Due to this facing issue while showing UIActivityViewController() share doc, I want to remove ...
iOSDude's user avatar
  • 294
1 vote
0 answers
34 views

UIAppearance Protocol for MessagesExtension App

I'm working on an iOS Messages Extension app. In this app, I use google autocomplete. To style an autocomplete table, Google recommends using the UIAppearance protocol in the AppDelegate.m file for ...
CodeBloke's user avatar
2 votes
1 answer
280 views

Custom UIBarButtonItem not working with appearance

i have subClass from UIBarButtonItem, when set setBackgroundImage with appearance not working, but create subClass from UIButton set image worked!. my code: MyCustomBarButtonItem.appearance()....
Alex's user avatar
  • 23
0 votes
1 answer
338 views

Setting UIBarButtonItem appearance resulted in weird behaviour with back button

let attributes = [ NSAttributedString.Key.foregroundColor: UIColor.orange, NSAttributedString.Key.font: UIFont.systemFont(ofSize: 22) ] // set nav bar button ...
K.L's user avatar
  • 55
1 vote
0 answers
357 views

Factual UIAppearance limitations for VC and swiftUI?

I was trying to go for a Theme object allowing me to well, manage the appearance of all my UI component toolbox. Even though I understand that UIAppearance is what Apple wants you to use, I am ...
itMaxence's user avatar
  • 1,385
1 vote
0 answers
1k views

Disable ScrollView bounces of a single view - SwiftUI

How can I disable ScrollView bounces of a single view without affecting the others? UITableView.appearance().bounces = false If I initialize this code it disable bounces of all ScrollView istance. Is ...
xmetal's user avatar
  • 791
0 votes
1 answer
2k views

Use UINavigationBar appearance "back" icon for custom button?

I need to achieve a custom navigation bar's "< back" button as seen in the push segue, but on a modal. I want to avoid too much hard-coding and found out about the property ...
Big Chungus's user avatar
0 votes
1 answer
1k views

iOS - Customize Navigation Bar for only some UIViewController

I have to add new screens to an existing app, that will use a different navigation bar style than the one that already exists and will be accessed from different screens. The idea would be to show the ...
allo86's user avatar
  • 1,016
0 votes
1 answer
2k views

Detect UITableViewCells that appear on the screen

I need to make a request when the user saw the UITableViewCell, I used func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) but this method call ...
Hamed's user avatar
  • 1,838
0 votes
2 answers
121 views

Is there a way to change UILabel line spacing throughout the whole app like using UIAppearance or something like that

I am trying to set the line spacing of all used UILabel in my app. I have found a solution to set line spacing using NSMutableParagraphStyle and attributedText but I am trying to find another solution ...
MAHMOUD OMARA's user avatar
3 votes
3 answers
1k views

UIBarButtonItem setBackButtonTitlePositionAdjustment doesn't work

Updated I want to change offset between Arrow and Text in Back Button in Navigation Bar. It works just fine until I set UINavigationBar.appearance().standardAppearance = newAppearance Here is the ...
Paul T.'s user avatar
  • 5,028
1 vote
0 answers
186 views

In Swift how to have a global tint color except in one place?

In my app I have a global tint color that I set in the app delegate like this and it works fine. I get that tint color everywhere. UIView.appearance().tintColor = globalTintColor I have a table ...
Murray Sagal's user avatar
  • 8,644
0 votes
1 answer
345 views

How to remove title from UIBarButtonItem.appearance() on iOS 10.3

I want to personalize the Back Button of my app to have a consistent looking. So I'm setting a image as the Back Button of a Navigation Bar. The code bellow works fine on any iOS above iOS 10. So, I'...
Tassio Marques's user avatar
1 vote
3 answers
741 views

How to change UIButton titlelabel fonts style and size in appearance()?

I am using the code below but it's not working. Can anyone help me to resolve this problem? UIButton.appearance().titleLabel?.font = UIFont(name: "Roboto-Regular", size: 20.0)
Muhammad Tayyab's user avatar
0 votes
1 answer
710 views

Swift.- UIAppereance of UISwitch does not take layer.cornerRadius into account

I am trying to use appearance to set general default layouts/designs across the app. For UISwitch, to set the off color not only at the border, one has to do a tweak (see Change color of UISwitch in &...
regina_fallangi's user avatar
0 votes
1 answer
219 views

UIAppearance of UILabel whithin UICollectionViewCell - selected/unselected

I am currently working with UIAppearance for the colors of all my outlets on my project, which allowed me to create my own "DIY" version of a nightmode on my iOS app. sample : UILabel.appearance()....
Crocobag's user avatar
  • 2,340
2 votes
0 answers
527 views

In iOS 13 - How can we implement more than two color modes / themes?

Looking at the brand new WWDC video Implementing Dark Mode on iOS we see that it can be handled quite easily. We can use the new dynamic system colors and they will have specific values depending on ...
HelloTimo's user avatar
  • 568
1 vote
1 answer
61 views

UIAppearance edge insets

I have a UIView subclass which I use in my app (And is in a 3rd party library) for displaying toast notifications. I want to modify this slightly for another app I'm working on and so I'm adding ...
simonthumper's user avatar
  • 1,834
0 votes
0 answers
38 views

Is there a list of all the UIApperance traits for each control/view? [duplicate]

So if we want to make all UIButtons have a red background, we can use UIButton.appearance().backgroundColor = UIColor.red. This is great and really convenient, but I'm wondering if there's a list of ...
Dymas's user avatar
  • 122
1 vote
0 answers
169 views

UISearchController appearance troubles

I'm currently developing an app with a search functionally, for that I use an UISearchController. The searchBar of the UISearchController is display within the NavigationItem. The problem is that ...
Jean-Charles Neboit's user avatar
1 vote
1 answer
359 views

Globally apply a gradient to the navigation bar and handle orientation changes

I need to apply a gradient globally to my status and navigation bars and have it adjust properly to orientation changes. Because I want this to be global, I'm trying to use UIAppearance. Surprisingly, ...
Jim's user avatar
  • 1,390
3 votes
1 answer
371 views

UIAppearance overwrites custom textColor on UILabel

I setup UILabel appearance in my app delegate using: UILabel.appearance().textColor = UIColor.white I also have a custom UIView subclass that contains a UILabel along with some other elements (...
BlackWolf's user avatar
  • 5,569
0 votes
0 answers
81 views

UIAppearance doesn't work into the reusable collection view cell

I have faced with the problem of using the UIAppearance proxy in reusable collection view cells. I apply an appearance (font) for the paricular label on the whole-project level, not for containers: ...
Axazeano's user avatar
  • 900
0 votes
0 answers
94 views

UINavigationBar.appearance().tintColor vs. UIBarButtonItem foregroundColor

I was using UIBarButtonItem appearance to set default font and colour. UIBarButtonItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor(red: 38/255, green: 110/...
Ro Man's user avatar
  • 48
1 vote
2 answers
869 views

Setting UITableViewCell selected background color with UIAppearence not working

I want to change the selected color of all my UITableViewCells. I am already using UIAppearence to define basic properties for some other UI elements and it works. However, setting let bgColorView = ...
Igor Kulman's user avatar
  • 16.4k
0 votes
2 answers
96 views

Swift - UIAppearance Class

I have label in my Storyboard connected to my View Controller via an IBOutlet I have extended UILabel as below extension UILabel { func winnerLabel() -> UILabel { let winnerLabel = ...
Ray Saudlach's user avatar
0 votes
1 answer
474 views

Round button on custom class with UIAppearance

I am trying to apply styles on a custom class using UIAppearance() class MainStyleButton: UIButton {} with a code: let buttonView = MainStyleButton.appearance() buttonView.backgroundColor = Style....
AlexR's user avatar
  • 33
4 votes
3 answers
3k views

Change TintColor of UIImagePickerController

I've set a global tintColor in my app by calling: UIView.appearance().tintColor = myColor However, the same color applies to the UIImagePickerController and only some of the UI elements are colored:...
Richard Topchii's user avatar
1 vote
0 answers
345 views

Swift theme change not working on UILabel within UITableViewCell

I am working on providing a light/dark theme option to the users in an iOS app. When I put the theme in app delegate, the app loads fine with the proper theme but when I toggle a switch in settings to ...
Rijaz Ali's user avatar
  • 265
0 votes
1 answer
58 views

Setting UIAppearance is not effecting cocoapod UI component

I am currently working on an app, which uses an cocoapod UI component. All my efforts to change the appearance (custom font) of the contained labels failed so far. Does anybody have experienced a ...
edsa-steffen's user avatar
1 vote
1 answer
1k views

Bar Button Item Tint Color not working

As you can see in the attached image, the bar button has its tint color set to red, however it is displayed in black. I think this is due to the text color still being black? Is there a way to change ...
Hans's user avatar
  • 2,482
1 vote
1 answer
364 views

Change UIAppearance of default UILabels only

I'm building an app with a theme switcher and I'd like to use Appearance to switch the textColor of UILabels that have the default color (black -> white). I assumed this would be possible and created ...
ColumnB's user avatar
  • 51
0 votes
0 answers
137 views

Reset Appearance for button font conditionally

My App supports two languages. Language can be changed within the app. For buttons I have set font through appearance property in app delegate. I need two different fonts based on language. I am ...
Ameer's user avatar
  • 725
3 votes
1 answer
2k views

iOS UILabel.appearance().textColor is not available

I am trying to change default text color for all labels in my app. I have tried to use UILabel.appearance().textColor, but it's not available for me. Can somebody advise what am I doing wrong? I have ...
DJ-Glock's user avatar
  • 1,401
9 votes
1 answer
601 views

Different appearances in different UINavigationControllers

In iOS 11 I'm currently changing the back button for my navigation controllers like this: UINavigationBar.appearance().backIndicatorImage = whiteBackButtonImage!.withRenderingMode(.alwaysOriginal) ...
tonik12's user avatar
  • 613
1 vote
2 answers
995 views

How to make UIAppearance proxies apply to programmatically created views?

I'm trying to use UIAppearance to create a theme for my app. Say I want all my UILabel's texts to be orange. I wrote: UILabel.appearance(whenContainedInInstancesOf: [UIView.self]).textColor = ....
Mick F's user avatar
  • 7,439
0 votes
1 answer
358 views

Make UINavigationBar have a gradient background using UIAppearance

Following this question, I am able to make a background gradient for a UINavigationBar, however when I try to set it through UIAppearance, the app crashes in the didFinishLaunching because there is no ...
jjatie's user avatar
  • 5,332
2 votes
3 answers
5k views

How to set backgroundColor of a ViewController with UIAppearance

I'm trying to use UIAppearance to configure the style of my Apps. It works perfectly with the UI components like UIView or UIButton, but it doesn't with UIViewControllers. I would like to do something ...
Jordi Jimenez's user avatar