开源软件名称(OpenSource Name):Ramotion/preview-transition开源软件地址(OpenSource Url):https://github.com/Ramotion/preview-transition开源编程语言(OpenSource Language):Swift 98.3%开源软件介绍(OpenSource Introduction):PREVIEW TRANSITIONPreview Transition is a simple preview gallery UI controller with animated tranisitionsWe specialize in the designing and coding of custom UI for Mobile Apps and Websites.Stay tuned for the latest updates:AboutThis project is maintained by Ramotion, Inc. Looking for developers for your project? Requirements
LicencePreview-transition is released under the MIT license. See LICENSE for details. InstallationJust add the Source folder to your project or use CocoaPods like this: pod "PreviewTransition" or Carthage users can simply add to their
Usage
public override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return <RowsCount>
}
public override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
return tableView.dequeueReusableCellWithIdentifier(<CellIdentifier>, forIndexPath: indexPath)
}
storyboards:
create a cell and inherit from or programmatically:
register a cell in viewDidLoad
let images = [image_name, image_name, image_name, image_name, image_name] // image names
public override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
guard let cell = cell as? ParallaxCell else {
return
}
let imageName = images[indexPath.row]
if let image = UIImage(named: imageName) {
cell.setImage(image, title: <SetText>)
}
} your tableViewController should look like DemoTableViewController Method
func backButtonHandler() {
popViewController()
}
public override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
// create viewController
let <YourViewController> = storyboard?.instantiateViewControllerWithIdentifier(<identifier>)
if case let viewController as <YourViewController> = viewController {
pushViewController(viewController)
}
}
// transparent background
UINavigationBar.appearance().setBackgroundImage(UIImage(), forBarMetrics: .Default)
UINavigationBar.appearance().shadowImage = UIImage()
UINavigationBar.appearance().translucent = true
UINavigationBar.appearance().tintColor = .whiteColor()
// set font
if let font = UIFont(name: <Font name> , size: 18) {
UINavigationBar.appearance().titleTextAttributes = [
NSForegroundColorAttributeName : UIColor.whiteColor(),
NSFontAttributeName : font
]
} |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论