-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
How to apply modifier to button? #152
Comments
hello @alelordelo are you sure its the background of the button and not ![]() For iOS:Inside
For macOS:in
Together with your button change, otherwise this happens: Hope this helps and let me know if I can close this issue :) |
I will introduce a style concept in later versions, where we'll be able to inject library-specific styles into the environment. Button styles won't work consistently, since some component needs to apply specific button styles within the components. |
I strongly believe the API of the RichTextKit (at least the core part) is so scalable, that it is easier (and more convenient) for API consumers not to use and try to modify the existing components but to create their own SwiftUI components where they inject just the context as In my other project, I created custom toolbar which accept the If you can wait, I will create Demo example and post it in here (or in the project) with description how to use context in order to create Api-Consumer UIViews. but the basic idea is:
where: ANYWAY! All possibilities.
Hope this helps! |
Thanks again @DominikBucher12 ! 1 - this is what I am doing atm. But there are so many layers of abstraction that even applying a simple button modifier is super hard. 3- would be super helpful if you can point how to inject a button modifier for ex. |
On the code bellow, I can apply a modifier to the buttonStyle:
.buttonStyle(.plain)
It gets added to the preview:
![Screenshot 2024-02-29 at 18 12 23](https://private-user-images.githubusercontent.com/17708751/309013987-7a38382c-0d26-4a3d-9abe-863b43b5a3c1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3MDU0NDEsIm5iZiI6MTcyNTcwNTE0MSwicGF0aCI6Ii8xNzcwODc1MS8zMDkwMTM5ODctN2EzODM4MmMtMGQyNi00YTNkLTlhYmUtODYzYjQzYjVhM2MxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA3VDEwMzIyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThhYTIyYzFhODVjNTZmZTA1YmNmMDBhYjM2Y2NlOGM0MzkwYzZkOWVlYTlmNjZiOWQ5NzZkZjM2NTVmMmE5MWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.k47faIuFvPnQ6IFImSg2bs869I_yPlo5CNfIoJT2wHo)
![Screenshot 2024-02-29 at 18 12 12](https://private-user-images.githubusercontent.com/17708751/309013979-ba286451-c6ee-4d9e-a6fb-157d92f41e5e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3MDU0NDEsIm5iZiI6MTcyNTcwNTE0MSwicGF0aCI6Ii8xNzcwODc1MS8zMDkwMTM5NzktYmEyODY0NTEtYzZlZS00ZDllLWE2ZmItMTU3ZDkyZjQxZTVlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA3VDEwMzIyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY2YmRkY2MxYjExZTlmYzc2Y2E4ZTM1MDkxNGMyY2U5OWZmYjg4MTcwMTM1MTM5YzZmYjExNWIxNWZhNGJjZWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.eTowA8aQUivn1hqrEEU1LRbVmQz5VeDkOEeRmQY1e70)
But when I build the app, it shows the default button style.
![Screenshot 2024-02-29 at 18 17 01](https://private-user-images.githubusercontent.com/17708751/309014743-6ed8514d-bb2a-46c5-a51c-1877e8dac675.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3MDU0NDEsIm5iZiI6MTcyNTcwNTE0MSwicGF0aCI6Ii8xNzcwODc1MS8zMDkwMTQ3NDMtNmVkODUxNGQtYmIyYS00NmM1LWE1MWMtMTg3N2U4ZGFjNjc1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA3VDEwMzIyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI2ZDRmMGYyZTk1ZTMzODVmZDU1NWU4MTZkMDg4YTE2NDI0ZjQxZTAzY2FkMzcxMjY3Y2NmNWI2YTMxYWFlN2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.VFOI6Ncmsz1veRHiKK4eO-1MFmbjCGALx545_zzOUa4)
How can I apply a modifier and change the button style?
The text was updated successfully, but these errors were encountered: