Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetTitleTextAttributes returns null for set properties in .NET8 iOS but works in Xamarin.iOS #21289

Closed
Ferum2704 opened this issue Sep 24, 2024 · 1 comment · Fixed by #21299
Labels
api-bindings bug If an issue is a bug or a pull request a bug fix
Milestone

Comments

@Ferum2704
Copy link

Ferum2704 commented Sep 24, 2024

Apple platform

iOS

Framework version

net8.0-*

Affected platform version

VS for Mac 2022, .NET 8.0.303

Description

Expected Behavior:

The UISegmentedControl.GetTitleTextAttributes method should return the correct UIStringAttributes set using UISegmentedControl.SetTitleTextAttributes in a .NET 8 iOS project, just as in an Xamarin.iOS project.

Actual Behavior:

In .NET 8 iOS, UISegmentedControl.GetTitleTextAttributes returns null for all set properties after setting title text attributes.
In Xamarin.iOS, UISegmentedControl.GetTitleTextAttributes correctly returns the set UITitleAttributes (font and foreground color).

Steps to Reproduce

I have created a test repository to reproduce this issue. Please find the project to reproduce the bug at the following link: https://github.com/Ferum2704/SegmentedControlTestApp.

Additionally, the property values (such as Font and ForegroundColor) are outputted to the Application Output window

Did you find any workaround?

No response

Relevant log output

No response

@rolfbjarne rolfbjarne added the bug If an issue is a bug or a pull request a bug fix label Sep 25, 2024
@rolfbjarne rolfbjarne added this to the Future milestone Sep 25, 2024
@rolfbjarne
Copy link
Member

I can reproduce this, fix is in progress.

rolfbjarne added a commit that referenced this issue Sep 25, 2024
1. Enable nullability.
2. Move Get|SetTitleTextAttributes to generated code.
3. Remove dead code (pre-.NET code paths).

Point 2. fixes #21289, so add tests for this scenario.

Fixes #21289.
azure-pipelines bot pushed a commit that referenced this issue Oct 1, 2024
1. Enable nullability.
2. Move Get|SetTitleTextAttributes to generated code.
3. Remove dead code (pre-.NET code paths).

Point 2. fixes #21289, so add tests for this scenario.

Fixes #21289.
rolfbjarne added a commit that referenced this issue Oct 2, 2024
…21345)

1. Enable nullability.
2. Move Get|SetTitleTextAttributes to generated code.
3. Remove dead code (pre-.NET code paths).

Point 2. fixes #21289, so add tests for this scenario.

Fixes #21289.


Backport of #21299

---------

Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
rolfbjarne added a commit that referenced this issue Oct 2, 2024
1. Enable nullability.
2. Move Get|SetTitleTextAttributes to generated code.
3. Remove dead code (pre-.NET code paths).

Point 2. fixes #21289, so add tests for this scenario.

Fixes #21289.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-bindings bug If an issue is a bug or a pull request a bug fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants