Close Menu
  • Home
  • AI
  • Big Data
  • Cloud Computing
  • iOS Development
  • IoT
  • IT/ Cybersecurity
  • Tech
    • Nanotechnology
    • Green Technology
    • Apple
    • Software Development
    • Software Engineering

Subscribe to Updates

Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

    What's Hot

    OpenAI’s GPT-5.5 in Microsoft Foundry: Frontier intelligence on an enterprise ready platform

    April 27, 2026

    Meta’s compute grab continues with agreement to deploy tens of millions of AWS Graviton cores

    April 27, 2026

    John Ternus could borrow from Microsoft’s playbook to reinvigorate Apple

    April 27, 2026
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    Big Tee Tech Hub
    • Home
    • AI
    • Big Data
    • Cloud Computing
    • iOS Development
    • IoT
    • IT/ Cybersecurity
    • Tech
      • Nanotechnology
      • Green Technology
      • Apple
      • Software Development
      • Software Engineering
    Big Tee Tech Hub
    Home»iOS Development»ios – SwiftUI toolbar symbol change without popping
    iOS Development

    ios – SwiftUI toolbar symbol change without popping

    big tee tech hubBy big tee tech hubMarch 13, 2026012 Mins Read
    Share Facebook Twitter Pinterest Copy Link LinkedIn Tumblr Email Telegram WhatsApp
    Follow Us
    Google News Flipboard
    ios – SwiftUI toolbar symbol change without popping
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link


    I’d like my toolbar item to become badged when it’s active. I thought the best looking way to do this would be with a custom SF Symbol because that matches the rest of my app.

    But apparently .toolbar labels ignore your symbol’s text guides? Because they look perfect when I export, but when I switch symbols, they pop up and down:

    toolbar icon popping up and down as badge is added

    .toolbar {
        ToolbarItem(placement: .topBarTrailing) {
            Button {
                isFilterSheetPresented = true
            } label: {
                Image(
                    systemName: activeFilterCount == 0 ? "tray" : "tray.badge"
                )
    //          .contentTransition(.symbolEffect(.replace))
                .symbolRenderingMode(activeFilterCount > 0 ? .palette: .none)
                .foregroundStyle(
                    activeFilterCount > 0 ? Color.accentColor : Color.primary,
                    Color.primary
                )
                }
                .accessibilityLabel("Filter")
            }
    }
    

    In my app, I’m using custom symbols:

    activeFilterCount==0 ? "custom.line.3.horizontal.decrease" : "custom.line.3.horizontal.decrease.badge"
    

    but tray.badge behaves the same way and it isn’t custom – the badge makes the symbol taller, so the underlying symbol pops down when it’s badged.

    I’ve disabled the .contentTransition because that 1. just makes it fade in and out up and down rather than pop, and 2. leads to other hilarity as all the other attributes change at random intervals.

    Every AI tool suggests that I wrap it in a frame, but that only prevents my icon changing size from bothering the other parts of the toolbar. I want my symbol to be laid out according to its text guides, not it’s bounding box, and the frame doesn’t fix that at all.

    If there is no “correct” answer, I can make it mostly work with custom

    .offset(y: activeFilterCount > 0 ? -3.5 : 0)
    

    And eyeballing an offset at every text size, but that seems deeply stupid.

    I wish there was a way to use .alignmentGuide() and/or .firstTextBaseline to actually lock it down, but I don’t think those work in toolbars. And I don’t think there’s a way to stick an HStack in there that won’t pop around all the same.

    I’m also pushing along trying to make it work with .badge() but that’s not going to be the ideal appearance.



    Source link

    change iOS popping SwiftUI Symbol Toolbar
    Follow on Google News Follow on Flipboard
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Copy Link
    tonirufai
    big tee tech hub
    • Website

    Related Posts

    Delphi + PAServer: How to correctly export iOS app with Notification Service Extension (appex) – missing provisioningProfiles in exportOptions.plist

    April 27, 2026

    ios – Apply shadow only outside of a SwifUI transparent button?

    April 26, 2026

    ios – How to add pictures after keynote update with iPadOS 26.3.1?

    April 25, 2026
    Add A Comment
    Leave A Reply Cancel Reply

    Editors Picks

    OpenAI’s GPT-5.5 in Microsoft Foundry: Frontier intelligence on an enterprise ready platform

    April 27, 2026

    Meta’s compute grab continues with agreement to deploy tens of millions of AWS Graviton cores

    April 27, 2026

    John Ternus could borrow from Microsoft’s playbook to reinvigorate Apple

    April 27, 2026

    Delphi + PAServer: How to correctly export iOS app with Notification Service Extension (appex) – missing provisioningProfiles in exportOptions.plist

    April 27, 2026
    Timer Code
    15 Second Timer for Articles
    20
    About Us
    About Us

    Welcome To big tee tech hub. Big tee tech hub is a Professional seo tools Platform. Here we will provide you only interesting content, which you will like very much. We’re dedicated to providing you the best of seo tools, with a focus on dependability and tools. We’re working to turn our passion for seo tools into a booming online website. We hope you enjoy our seo tools as much as we enjoy offering them to you.

    Don't Miss!

    OpenAI’s GPT-5.5 in Microsoft Foundry: Frontier intelligence on an enterprise ready platform

    April 27, 2026

    Meta’s compute grab continues with agreement to deploy tens of millions of AWS Graviton cores

    April 27, 2026

    Subscribe to Updates

    Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

      • About Us
      • Contact Us
      • Disclaimer
      • Privacy Policy
      • Terms and Conditions
      © 2026 bigteetechhub.All Right Reserved

      Type above and press Enter to search. Press Esc to cancel.