Browse Source

VLCEditToolbar: Add top shadow to differenciate from background

This increases the "hidden height" since the shadow was visible at 50.
Soomin Lee 6 years ago
parent
commit
2dfecaca0f

+ 2 - 2
Sources/MediaCategories/MediaCategoryViewController.swift

@@ -120,7 +120,7 @@ class VLCMediaCategoryViewController: UICollectionViewController, UICollectionVi
     func setupEditToolbar() {
         editToolbar.translatesAutoresizingMaskIntoConstraints = false
         view.addSubview(editToolbar)
-        editToolbarConstraint = editToolbar.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 50)
+        editToolbarConstraint = editToolbar.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 60)
         NSLayoutConstraint.activate([
             editToolbarConstraint!,
             editToolbar.leadingAnchor.constraint(equalTo: view.leadingAnchor),
@@ -193,7 +193,7 @@ class VLCMediaCategoryViewController: UICollectionViewController, UICollectionVi
 
     private func displayEditToolbar() {
         UIView.animate(withDuration: 0.3) { [weak self] in
-            self?.editToolbarConstraint?.constant = self?.isEditing == true ? 0 : 50
+            self?.editToolbarConstraint?.constant = self?.isEditing == true ? 0 : 60
             self?.view.layoutIfNeeded()
         }
     }

+ 2 - 0
Sources/VLCEditToolbar.swift

@@ -89,6 +89,8 @@ class VLCEditToolbar: UIView {
     }
 
     private func setupView() {
+        layer.shadowOpacity = 0.1
+        layer.shadowOffset = CGSize(width: 0, height: -1)
         backgroundColor = PresentationTheme.current.colors.background
     }