question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there any possible way to add the image icon before the value/tab name ? if yes please help me. i do like this but the text is not adjusted with the image. badges={[ <Text style={styles.badgeText}> <Image style={styles.badgeImage1} source={require("./Images/3.png")} />Personal </Text>, <Text style={styles.badgeText}> <Image style={styles.badgeImage} source={require("./Images/2.png")} />Doctor </Text>, <Text style={styles.badgeText}> <Image style={styles.badgeImage2} source={require("./Images/1.png")} />Security </Text> ]} values={["", "", ""]}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
kirankalyan5commented, Jul 4, 2018

Hi @sandeep0607 , you can do it this way.

create a function which renders inlineImage with text

  renderValueWithImage(text, imageUri) {
    return (
      <Text> 
        <Image source={imageUri} />
        {text}
      </Text>
      )
  }

Pass it to the values props.

  <SegmentedControlTab
          values={[this.renderValueWithImage('Creation', creation),this.renderValueWithImage('Group', group)]}
          selectedIndex={this.state.selectedIndex}
          onTabPress={this.handleSingleIndexSelect}
        />

img_e0b8b8892502-1

0reactions
kirankalyan5commented, Jul 12, 2019

@zhigang1992 yes, sorry for that 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

32683 Tab Bar Images, Stock Photos & Vectors - Shutterstock
Tab Bar royalty-free images. 32,683 tab bar stock photos, vectors, and illustrations are available royalty-free. See tab bar stock video clips.
Read more >
Changing UITabBar item image on se… - Apple Developer
Set the image in the Tab Bar Item section of Attributes Inspector. Same thing for selected Image. And you can define the default...
Read more >
Customizing Tab Bar Controller Icons. - Make App Pie
Stop the app. Images in the tab bar are by default template images. A template image is a monochrome image using the tint...
Read more >
How to set image in a tab bar item in Swift? - Stack Overflow
In your MainTabbarViewController. Bind the outlet of your tabbar: @IBOutlet weak var myTabBar: UITabBar? override func viewDidLoad() { super ...
Read more >
Add Custom Images in Tab Bar Swift 5 - YouTube
In this Tutorial we learn about Adding Custom Images in TabView Controller in IOS Swift 5- Setting Image Size for tabView Controller- Tabbed ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found