Skip to main content
added 3 characters in body
Source Link
soundflix
  • 2.7k
  • 12
  • 16
  • 33

We create buttona UIButton by initinginitialising it with a configuration and embedding it within a (horizontal) UIStackViewUIStackView. We setContentHuggingPriorityset setContentHuggingPriority to requiredrequired because we want the button to only take up as much space as it actually needs.

        var configuration = UIButton.Configuration.filled()
        configuration.title = "Send to"
        configuration.baseBackgroundColor = .red

        let customButton = UIButton(configuration: configuration)
        customButton.setContentHuggingPriority(.required, for: .horizontal)
 

When running attached to the debugger, it looks like this: what it should look like

what it should look like

When we open the app manually (byby tapping on the icon) so, i.e. not connected to the debugger, it looks like this: what it looks like

what it looks like

When I attach the debugger after I launched the app manually and inspect the view hierarchy I see that the intrinsic content size width is 59 instead of 83 (when attached to debugger).

It seems that the intrinsic content size is wrong, but why? Is it a bug at Apple? What could be wrong?

We create button by initing it with a configuration and embedding it within a (horizontal) UIStackView. We setContentHuggingPriority to required because we want the button to only take up as much space as it actually needs.

        var configuration = UIButton.Configuration.filled()
        configuration.title = "Send to"
        configuration.baseBackgroundColor = .red

        let customButton = UIButton(configuration: configuration)
        customButton.setContentHuggingPriority(.required, for: .horizontal)
 

When running attached to the debugger it looks like this: what it should look like

When we open the app manually (by tapping on the icon) so not connected to the debugger, it looks like this: what it looks like

When I attach the debugger after I launched the app manually and inspect the view hierarchy I see that the intrinsic content size width is 59 instead of 83 (when attached to debugger).

It seems that the intrinsic content size is wrong, but why? Is it a bug at Apple? What could be wrong?

We create a UIButton by initialising it with a configuration and embedding it within a (horizontal) UIStackView. We set setContentHuggingPriority to required because we want the button to only take up as much space as it actually needs.

    var configuration = UIButton.Configuration.filled()
    configuration.title = "Send to"
    configuration.baseBackgroundColor = .red

    let customButton = UIButton(configuration: configuration)
    customButton.setContentHuggingPriority(.required, for: .horizontal)

When running attached to the debugger, it looks like this:

what it should look like

When we open the app manually by tapping on the icon, i.e. not connected to the debugger, it looks like this:

what it looks like

When I attach the debugger after I launched the app manually and inspect the view hierarchy I see that the intrinsic content size width is 59 instead of 83 (when attached to debugger).

It seems that the intrinsic content size is wrong, but why? Is it a bug at Apple? What could be wrong?

edited body
Source Link

We create button by initing it with a configuration and embedding it within a (horizontal) UIStackView. We setContentHuggingPriority to required because we want the button to only take up as much space as it actually needs.

        var configuration = UIButton.Configuration.filled()
        configuration.title = "Send to"
        configuration.baseBackgroundColor = .red

        let customButton = UIButton(configuration: configuration)
        customButton.setContentHuggingPriority(.required, for: .horizontal)

When running attached to the debugger it looks like this: what it should look like

When we open the app manually (by tapping on the icon) so not connected to the debugger, it looks like this: what isit looks like

When I attach the debugger after I launched the app manually and inspect the view hierarchy I see that the intrinsic content size width is 59 instead of 83 (when attached to debugger).

It seems that the intrinsic content size is wrong, but why? Is it a bug at Apple? What could be wrong?

We create button by initing it with a configuration and embedding it within a (horizontal) UIStackView. We setContentHuggingPriority to required because we want the button to only take up as much space as it actually needs.

        var configuration = UIButton.Configuration.filled()
        configuration.title = "Send to"
        configuration.baseBackgroundColor = .red

        let customButton = UIButton(configuration: configuration)
        customButton.setContentHuggingPriority(.required, for: .horizontal)

When running attached to the debugger it looks like this: what it should look like

When we open the app manually (by tapping on the icon) so not connected to the debugger, it looks like this: what is looks like

When I attach the debugger after I launched the app manually and inspect the view hierarchy I see that the intrinsic content size width is 59 instead of 83 (when attached to debugger).

It seems that the intrinsic content size is wrong, but why? Is it a bug at Apple? What could be wrong?

We create button by initing it with a configuration and embedding it within a (horizontal) UIStackView. We setContentHuggingPriority to required because we want the button to only take up as much space as it actually needs.

        var configuration = UIButton.Configuration.filled()
        configuration.title = "Send to"
        configuration.baseBackgroundColor = .red

        let customButton = UIButton(configuration: configuration)
        customButton.setContentHuggingPriority(.required, for: .horizontal)

When running attached to the debugger it looks like this: what it should look like

When we open the app manually (by tapping on the icon) so not connected to the debugger, it looks like this: what it looks like

When I attach the debugger after I launched the app manually and inspect the view hierarchy I see that the intrinsic content size width is 59 instead of 83 (when attached to debugger).

It seems that the intrinsic content size is wrong, but why? Is it a bug at Apple? What could be wrong?

deleted 14 characters in body
Source Link

We create button by initing it with a configuration and embedding it within a (horizontal) UIStackView. We setContentHuggingPriority to required because we want the button to only take up as much space as it actually needs.

        var configuration = UIButton.Configuration.filled()
        configuration.title = "Send to"
        configuration.baseBackgroundColor = .red

        let customButton = UIButton(configuration: configuration)
        customButton.setContentHuggingPriority(.required, for: .horizontal)

When running attached to the debugger it looks like this: enter image description herewhat it should look like

When we open the app manually (by tapping on the icon) so not connected to the debugger, it looks like this: enter image description herewhat is looks like

When I attach the debugger after I launched the app manually and inspect the view hierarchy I see that the intrinsic content size width is 59 instead of 83 (when attached to debugger).

It seems that the intrinsic content size is wrong, but why? Is it a bug at Apple? What could be wrong?

We create button by initing it with a configuration and embedding it within a (horizontal) UIStackView. We setContentHuggingPriority to required because we want the button to only take up as much space as it actually needs.

        var configuration = UIButton.Configuration.filled()
        configuration.title = "Send to"
        configuration.baseBackgroundColor = .red

        let customButton = UIButton(configuration: configuration)
        customButton.setContentHuggingPriority(.required, for: .horizontal)

When running attached to the debugger it looks like this: enter image description here

When we open the app manually (by tapping on the icon) so not connected to the debugger, it looks like this: enter image description here

When I attach the debugger after I launched the app manually and inspect the view hierarchy I see that the intrinsic content size width is 59 instead of 83 (when attached to debugger).

It seems that the intrinsic content size is wrong, but why? Is it a bug at Apple? What could be wrong?

We create button by initing it with a configuration and embedding it within a (horizontal) UIStackView. We setContentHuggingPriority to required because we want the button to only take up as much space as it actually needs.

        var configuration = UIButton.Configuration.filled()
        configuration.title = "Send to"
        configuration.baseBackgroundColor = .red

        let customButton = UIButton(configuration: configuration)
        customButton.setContentHuggingPriority(.required, for: .horizontal)

When running attached to the debugger it looks like this: what it should look like

When we open the app manually (by tapping on the icon) so not connected to the debugger, it looks like this: what is looks like

When I attach the debugger after I launched the app manually and inspect the view hierarchy I see that the intrinsic content size width is 59 instead of 83 (when attached to debugger).

It seems that the intrinsic content size is wrong, but why? Is it a bug at Apple? What could be wrong?

Source Link
Loading