I have added Scroll View and Stack View in it, but it does not seems to be the solution. I would like to have an effect like below: One photo and 3 labels under the photo in a container. I have 12 items like this, that is why I need ScrollView. Any ideas how to make it step by step? Here is the solution (airbnb app) I would like to have (I needed to put it on imgur, because there was an error, while adding a photo here):
https://imgur.com/pFY3DX5
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello, as discussed in my previous topic with @Claude31 (Link ) I have a problem with riding off layout. Should I register the nib somewhere and in nib put constraints for a cell? Below I'm showing What I've got so far and how it looks like on device:
I have tried many solution but nothing helped, so i just putted constraints for collection view. I dont know how to put constraints for the cell (It is greyd out), maybe in nib file?:
I have defined there class and identifier.
Here is how it looks like on device:
I would like it to look like in the first screen shot (storyboard).
Here are my files connected with collectionview vc:
First one is Controller with code, another two are connected with the cell.
Here is the ModernizmCollectionViewCell file:
import UIKit
class ModernizmCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var imageCell: UIImageView!
@IBOutlet weak var navButton: UIIButton!
@IBOutlet weak var title: UILabel!
@IBOutlet weak var subTitle: UILabel!
@IBOutlet weak var locationLabel: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
}
Many thank for your help.
Hello,
I'm looking for help with annotationView. What I'm going to do is to have already added icons in annotations, but when Im going to tap the annotation (icon) I would like to see the button in annotation view frame, as in this:
After I click it I would like to see this white frame and uibutton:
I was looking for help in old discussion, but did notg found an answer: UIButton in AnnotationView - How to keep icon and button
Here is my viedidload:
super.viewDidLoad()
mapView.register(MKMarkerAnnotationView.self, forAnnotationViewWithReuseIdentifier: "identifier") \\ important part
checkLocationServices()
znajdzSzczytyNaMapie(szczyty)
circles = szczyty.map {
MKCircle(center: $0.coordinate, radius: 100)
}
mapView.addOverlays(circles!)
mapView.delegate = self
}
Here in viewdidload I've added mapView.register(MKMarkerAnnotationView.self, forAnnotationViewWithReuseIdentifier: "identifier") to viewdidload to register indentifier.
Here is the rest of the code:
guard !(annotation is MKUserLocation) else { return nil }
//let annotationView = MKMarkerAnnotationView(annotation: annotation, reuseIdentifier: "MyMarker")
let identifier = "identifier"
//guard let annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: identifier) as? MKMarkerAnnotationView else { return nil }
guard let annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: identifier, for: annotation) as? MKMarkerAnnotationView else { return nil }
let btn = UIButton(type: .detailDisclosure)
annotationView.rightCalloutAccessoryView = btn
switch annotation.title!! {
ase "Turbacz":
annotationView.markerTintColor = UIColor(red: 0.86, green: 0.99, blue: 0.79, alpha: 1.00)
annotationView.glyphImage = UIImage(named: "bald")
case "example":
annotationView.markerTintColor = UIColor(red: 0.80, green: 0.98, blue: 0.73, alpha: 1.00)
annotationView.glyphImage = UIImage(named: "bear")
default:
annotationView.markerTintColor = UIColor.green
annotationView.glyphImage = UIImage(named: "gora")
}
return annotationView
}
But Still I got this:
Hello,
I have a TextView in a language different than english. I would like to add a button which translate this text in a text view to english and german. It can looks like this, in the Daily Art app:
Many thanks to any ideas and tips how to make it.