Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not TargetHolderView to be Rectangle for UITableViewCell #73

Closed
ajaysharmalike opened this issue Sep 6, 2018 · 8 comments
Closed

Not TargetHolderView to be Rectangle for UITableViewCell #73

ajaysharmalike opened this issue Sep 6, 2018 · 8 comments

Comments

@ajaysharmalike
Copy link

ajaysharmalike commented Sep 6, 2018

Hi @quangctkm9207

Thanks for such an handy library. I tried using this library which works like charm but when I add it to custom tableView, I am not able to get the actual effect of Showcase in Rectangle. (Though its working fine if defined the radius , but then it shows in TargetHolderView in Circle)

Below is the code snippet :

class func showShowcaseForTableSection(tableview : UITableView, viewController : UIViewController,  showcasetype : ShowCaseType, section: Int, row: Int){
        
        let showcase = MaterialShowcase()
        showcase.setTargetView(tableView: tableview, section: section, row: row)
        showcase.primaryText = showcasetype.primaryText
        showcase.secondaryText = ""
//        showcase.targetHolderRadius = 80 // Just need to ignore this, as I was rectangle targetHolder
//        showcase.targetHolderColor = UIColor.white
        showcase.shouldSetTintColor = false // Tried using this as well as
        showcase.backgroundPromptColor = UIColor.darkHotPink
        showcase.isTapRecognizerForTagretView = false
        showcase.delegate = viewController as? MaterialShowcaseDelegate
        showcase.show(completion: { DataManager.sharedInstance.tutorialStepsCounter += 1 })
    }

Can you help me out where I am making the mistake or I doubt, if this gonna work with custom tableViewCells too.

@quangctkm9207
Copy link
Collaborator

Hi @ajaysharmalike ,
Did you check out the sample for TableView case? It worked on your side?

@ajaysharmalike
Copy link
Author

@quangctkm9207 Yes, that's working fine in demo. And adding this library to a tableview requires tableview with section & row value only. But this doesn't seems to be working in either case.

@quangctkm9207
Copy link
Collaborator

Can you show me a screenshot?
The code behind TableView item showcase can be found here.

@objc public func setTargetView(tableView: UITableView, section: Int, row: Int) {

It suggests that targetHolderRadius should be 0 and inside TableView item, you should have a background item which is in rectangle shape.

@ajaysharmalike
Copy link
Author

Can you show me a screenshot?
The code behind TableView item showcase can be found here.
material-showcase-ios/MaterialShowcase/MaterialShowcase.swift
Line 143 in c1ea1ae
@objc public func setTargetView(tableView: UITableView, section: Int, row: Int) {

It suggests that targetHolderRadius should be 0 and inside TableView item, you should have a background item which is in rectangle shape.

Here are the reference screenshots :

  1. Default implementation on UITableView
    img_1754

  2. Adding targetHolderRadius value
    img_85ca030cfa97-1

In either of cases, Showcase on cell is not getting rectangle.

@quangctkm9207
Copy link
Collaborator

  1. Please do not set targetHolderRadius more than 0.
  2. And at that time, the showcase will use the background of your tableview item as target holder.
    So, in your storyboard, you should add background color or background image to your tableview item's content. I saw that it seem to be transparent currently.

@ajaysharmalike
Copy link
Author

Yupp ... It worked while setting the background color for the cell ContentView. And shouldSetTintColor to false incase cell contains image.

@ajaysharmalike
Copy link
Author

ajaysharmalike commented Sep 13, 2018

Thanks for your inputs.

@quangctkm9207
Copy link
Collaborator

@ajaysharmalike , Did you solve the issue by yourself?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants