Replies: 1 comment 8 replies
-
|
이런 식으로 뷰 라이프사이클 메서드에서 tableView height constraint를 업데이트를 할 수는 있을 것 같습니다. 그런데 구현하고 싶은 UI가 따로 있는건가요? 과제 1은 위와 같은 workaround를 사용하지 않아도 완료할 수 있을 것 같아서요. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
private lazy var tableView: UITableView를 만들고,view.addSubview(tableView)한다음에이렇게 하면 전체 화면이 TableView로 꽉 차게 됩니다.
그런데 과제를 위해 TableView의 높이는 하단까지 꽉 차는게 아니라 높이가 TableView의 높이만큼으로 딱 맞춰졌으면 좋겠는데 이게 잘 안되네요
대부분 이걸 하라고 알려주는데, 이건 하나마나 달라지는 게 없습니다. (똑같이 화면 꽉 참)
이 옵션은 셀 별로 높이가 달라질 때 그걸 동적으로 조절해 주는 거지, TableView 전체 높이와 관련된 게 아닌 것 같기도 하네요
그렇다고 snp.makeConstraints 쪽을 건드리면, 대부분 그냥 검정 화면만 꽉 차게 됩니다. (아무것도 안 뜨게 되는 거죠?)
안드로이드의 wrap_content 같은 걸 하려면 snp.makeConstraints를 어떻게 줘야되나요?
tableView.backgroundColor = .red 를 줬을 때
빨간 부분이 아예 안 보이게 하고 싶습니다.(딱 content만큼의 size를 갖도록)
Beta Was this translation helpful? Give feedback.
All reactions