lourenco-marinho / actionbutton Goto Github PK
View Code? Open in Web Editor NEWAction button is a Floating Action Button inspired from Google Inbox implemented in Swift
License: MIT License
Action button is a Floating Action Button inspired from Google Inbox implemented in Swift
License: MIT License
You should create a documentation for this.. This is great, and I think a lot of people would like to leverage this. This is my question:
How do you change the title of the button when the ActionButton is tapped? For example, once the ActionButton is tapped, 3 options will appear. If optionA is selected, change the state of the ActionButton to optionA and hide the visual blur. I know it's written in swift, and I can take a look at the code later, just want to make sure if it's even possible.
I noticed that when the content view is applied to the window on toggles after the first one a slight jump/choppiness is noticeable on to view components as the fade in and out.
I've done a small amount of troubleshooting so far and it might be due to either the alpha getting applied (maybe it needs an animate block?) or how the view is added/removed on action button toggle.
Thought before I go further, you may have a better idea where the issue may be.
pull request #28
while not approved:
pod 'ActionButton', :git => 'https://github.com/anukhov/ActionButton.git', :branch => "swift3"
Is there a way to have a Tap and a LongPress Action on the button?
How can fix?
Thanks
the app is constantly getting crashed when I tap the action button with error EXE_BAD_ACCESS could you please help what is causing is?
I am using your frame work for implementing floating action button. I tried to use an image for the button by setting actionButton.setImage = "".*The problem now is the button is not rotating as it was earlier. Any idea??
*
```
let twitterImage = UIImage(named: "twitter_icon.png")!
let plusImage = UIImage(named: "googleplus_icon.png")!
let twitter = ActionButtonItem(title: "Twitter", image: twitterImage)
twitter.action = { item in print("Twitter...") }
let google = ActionButtonItem(title: "Google Plus", image: plusImage)
google.action = { item in print("Google Plus...") }
actionButton = ActionButton(attachedToView: self.view, items: [twitter, google])
actionButton.action = { button in button.toggleMenu() }
actionButton.setImage(UIImage(named: "bottom-logo-icon.png")!, forState: .Normal)
actionButton.backgroundColor = UIColor.clearColor()
Any chance of making iOS 7 compatible, even if dropping the blur effect support?
The button we place in a scroll view controller (or table view controller) is also scrolled on scroll event. Can you change this to hide or stay at its position even on scroll view.
Hello sir ...Am not able to change the code so that the main action button to be aligned in the center for all the universal devices ... Can you help me with the changes that need to be done
When using the code in Objective-C project, it crashes on line number 50: self.parentView = view of ActionButton.swift class. This is how I have implemented:
ActionButtonItem *item = [[ActionButtonItem alloc]initWithTitle:@"New Task" image:nil];
ActionButtonItem *item2 = [[ActionButtonItem alloc]initWithTitle:@"New Event" image:nil]; ActionButtonItem *item3 = [[ActionButtonItem alloc]initWithTitle:@"New Project" image:nil];
ActionButton *actionButton = [[ActionButton alloc]initWithAttachedToView:self.view items:@[item,item2,item3]];
i put this code
[actionButton setAction:^(ActionButton * button) {
[button toggleMenu];
}];
its not triggering the togglemenu
platform :ios, "9.0"
use_frameworks!
target 'uygulamacopreview' do
pod 'ActionButton', '~> 0.1.5' #floating action button
end
when i run command pod install this is what i get:
[!] Unable to satisfy the following requirements:
- ActionButton (~> 0.1.5) required by Podfile
- ActionButton (= 0.1.5) required by Podfile.lock
Specs satisfying the ActionButton (~> 0.1.5), ActionButton (= 0.1.5) dependency were found, but they required a higher minimum deployment target.
can you plz add the ability to hide the action button compleetlty
click button on click
First thing you have done an amazing job - thank you very much! Secondly, I wanted to know if we can add a transition between screens when you press the button (+) not on Google and Twitter. I know that the class is NSObject and not UIButton, and that can create problems with the method "touchesBegan: withEvent:" and with "Prepareforsegue"
In simple terms, I want to press the button and it will take me to another screen
tnx ๐
it would be great be able change the opacity for background and attributes for item buttons and the blur effect too.
I don't know if this is possible, but is there a way to show this on top of a UITableViewController? I have a TabBarController that holds around 3 UITableViewControllers, and 2 UICollectionViewControllers. Is there a way to initialize this on any one of them? This is awesome btw.
Received error: _SwiftValue nsli_superitem
Due to the following in ActionButton.swift based on breakpoint in installConstraints:
(line 138) let views = ["floatButton":self.floatButton, "parentView":self.parentView]
Can change to the following to fix:
let views: [String: UIView] = ["floatButton":self.floatButton, "parentView":self.parentView]
Based on:
http://stackoverflow.com/questions/39622996/swift-3-error-swiftvalue-nsli-superitem
Hi,
Thanks you, Good work!!!!
I don't how to make the straight action to circular action. Is there any possibility to do. I searched but found nothing.
Please help me....
Thank you once again.....
how to view cell in down wards on tapping fab button
How would I make it so that the menu toggles once the label has been pressed? The label and the toggle menu are in separate classes so I couldn't think of anything else other than using nsnotification
Hello,
I've tried to implement a Table View inside the View Controller in which I've the actionButton working fine.
If I do so, my actionButton disappear under the Table View.
Any suggestion?
I can able to move to another screen.But when i come back i again see the actionsheet open.
I wanted to hide the floating button before navigating to another screen.
let ActionBtnAddaction = ActionButtonItem(title: "Add screen", image:nil)
ActionBtnAddaction.action = { item in self.performSegue(withIdentifier: "NavToAddscreen", sender: nil)
}
actionButton = ActionButton(attachedToView: self.view, items: [ActionBtnAddSite])
actionButton.action = { button in button.toggleMenu() }
actionButton.setTitle("+", forState: UIControlState())
actionButton.backgroundColor = UIColor(red: 238.0/255.0, green: 130.0/255.0, blue: 34.0/255.0, alpha:1.0)
Hi,
Thanks dude, you have created a nice tool!
I have read the source code that the position for ActionButton is fixed at bottom right of current screen, not be able to adjust the position, so if someone uses Action in a Tab pattern App., the ActionButton can be hidden by the Tab Controller.
So I guess whether you can add parameters in the initializer or create a helper method for changing the layout parameters.
I tried to change the init method to:
public init(attachedToView view: UIView, items: [ActionButtonItem]?, tailingOffset: CGFloat = 15.0, bottomOffset: CGFloat = 15.0) {
......
self.installConstraints(tailingOffset, bottomOffset: bottomOffset)
}
private func installConstraints(tailingOffset: CGFloat = 15.0, bottomOffset: CGFloat = 15.0) {
......
let trailingSpacing = NSLayoutConstraint.constraintsWithVisualFormat("V:[floatButton]-(tailingOffset)-|", options: NSLayoutFormatOptions.AlignAllCenterX, metrics: nil, views: views)
let bottomSpacing = NSLayoutConstraint.constraintsWithVisualFormat("H:[floatButton]-(bottomOffset)-|", options: NSLayoutFormatOptions.AlignAllCenterX, metrics: nil, views: views)
......
}
Hope you can change for some customization.
Thanks
Leon
I Want to try to set image over the "+" sign. But its not working.
let btnImage = UIImage(named: "search")
self.floatButton.setImage(btnImage, for: UIControlState())
Please let me know if any change this button image.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.