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

DIA-2935 Dynamic frame by constrains #536

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class SPGDPRManagePreferenceViewController: SPNativeScreenViewController {
setHeader()
loadTextView(forComponentId: "CategoriesHeader", textView: descriptionTextView, bounces: false)
descriptionTextView.flashScrollIndicators()
dynamicFrameForDescription()
loadButton(forComponentId: "AcceptAllButton", button: acceptButton)
loadButton(forComponentId: "SaveButton", button: saveAndExit)
loadSliderButton(forComponentId: "CategoriesSlider", slider: categorySlider)
Expand Down Expand Up @@ -145,6 +146,17 @@ class SPGDPRManagePreferenceViewController: SPNativeScreenViewController {
header.spTitleText = viewData.byId("Header") as? SPNativeText
header.onBackButtonTapped = { [weak self] in self?.dismiss(animated: true) }
}

func dynamicFrameForDescription() {
let width = descriptionTextView.frame.size.width
let height = descriptionTextView.frame.height
descriptionTextView.translatesAutoresizingMaskIntoConstraints = true
descriptionTextView.sizeToFit()
descriptionTextView.frame.size.width = width
if descriptionTextView.frame.size.height > height {
descriptionTextView.frame.size.height = height
}
}
}

// MARK: UITableViewDataSource
Expand Down
Loading