Open vchaubey-ontic opened 1 year ago
Hello, @vchaubey-ontic!
You can provide string with image name in your enum
with tab items and use this string to show your custom images in the implementation of custom tab items (see TabItemStyle
)
@onl1ner as i checked the code everywhere you have used Image with SystemName
Image(systemName: icon)
but I want to use simple name
like Image(icon)
, how to achieve it, could you give an example.
@vikaschaubey57, I see. So, in this case you could implement your own tab item style and use your own image name there. The default implementation is using systemName
initializer, because it is supposed to replicate the behavior of default tab bar
Traditional in SwiftUI you would just use Image(“ImageName”) where ImageName is the name you gave the image in the asset’s catalog.
On Mon, May 8, 2023 at 1:03 AM Vikash Kumar Chaubey < @.***> wrote:
@onl1ner https://github.com/onl1ner as i checked the code everywhere you have used Image with SystemName Image(systemName: icon) but I want to use simple name like Image(icon), how to achieve it, could you give an example.
— Reply to this email directly, view it on GitHub https://github.com/onl1ner/TabBar/issues/16#issuecomment-1537799451, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALQXYGPXOQ7RRXGJC7JEZWLXFCEEDANCNFSM6AAAAAAXW7UJOU . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Resurrecting this to say it is counter-intuitive to require systemName
, or the documentation should at least say so. It would be great if the library provided an easy way to use Asset Library images as well without jumping through hoops.
Well yeah, I see your point @jedmund. The systemName
initializer is used only in the default implementation of style, but I will work on adding a way to easily use images from assets
How could we give the asset string name instead of giving custom image name?