Giter Club home page Giter Club logo

smoothtab's People

Contributors

vitalii-tym avatar yersar avatar yervandsar avatar yervsar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

smoothtab's Issues

Can't make first tab selected by default

SmoothTabView has tapItem(at:) to programmatically make some tab selected.
However, attempt to select the very first one (at index 0) gives no results. Most probably because of the if oldValue != selectedSegmentIndex check in selectedSegmentIndex's didSet

As a workaround have to do this:

smoothTabView.tapItem(at: 1)
smoothTabView.tapItem(at: 0)

It would be good to support badges

[feature request]
often it happens that there is a need to add a badge near tab to indicate there is something that needs attention inside it. It would be a great addition.

For example:

screenshot 2018-09-20 11 36 52

Want to give different images in Tab section

Hi Team,
I have an requirement, I am trying to give different images in Tab section, As I saw in Example code it is having only single image, Can you please help me Where I can put the code exactly.

I took the code:
let instagram_item = OurTeams.allTeams.map { SmoothTabItem(
title: $0.rawValue,
image: $0.instagram_image,
selectedImage: $0.selected_instagram_Image,
tintColor: UIColor(red: 96/255, green: 197/255, blue: 227/255, alpha: 1)
)
}

	let facebook_item =  OurTeams.allTeams.map { SmoothTabItem(
			title: $0.rawValue,
			image: $0.facebook_image,
			selectedImage: $0.selected_facebook_Image,
			tintColor: UIColor(red: 96/255, green: 197/255, blue: 227/255, alpha: 1)
			)
		}
	let twitter_item =  OurTeams.allTeams.map { SmoothTabItem(
			title: $0.rawValue,
			image: $0.twitter_image,
			selectedImage: $0.selected_twitter_Image,
			tintColor: UIColor(red: 96/255, green: 197/255, blue: 227/255, alpha: 1)
			)
		}
	
	var items: [SmoothTabItem] = [instagram_item, facebook_item, twitter_item]

But it is throwing an error: Cannot convert value of type '[SmoothTabItem]' to expected element type 'SmoothTabItem'

Uploading Screenshot 2020-10-16 at 3.36.28 PM.png…

Adapting to different screen widths by automatically placing tabs evenly

Found that while it is possible to set all needed parameters to make tabs evenly take the width of the screen. However, this only works for a screen with fixed size.
As a workaround it is possible to detect the device type and change itemsMargin, but it would be cool if SmoothTabView was able to to place its tabs evenly in any screen.
Also I will need to dynamically hide/show some of the tabs, so that hardcoding itemsMargin won't work work in my case.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.