그룹테이블에서 배경색상 적용하기

iOS6 버전이 나온지 좀 되서 아실만한 분들은 많이 있으시리라 생각합니다만, 혹 모르시는 분들을 위해 몇 자 적어보겠습니다.

보통 테이블에서의 배경색상은 tableView.backgroundColor으로 설정합니다.
iOS6에서 Plain 스타일의 테이블에서는 잘 작동하는데요, Group 스타일의 테이블에서는 그림1과 같이 전혀 먹지 않습니다.

iOS Simulator Screen shot 2013. 2. 11. 오후 4.33.08
그림1

이것을 해결하기 위해서는 다음과 같은 방법을 쓰면 해결이 됩니다.

소스코드를 설명하기 앞서 왜 이렇게 되었는지에 대해 설명드리겠습니다.

iOS6으로 업그레이드 되면서 기존의 UIColor 속성인 groupTableViewBackgroundColor가 deprecated 되었습니다.
이로 인해 테이블 그룹 스타일이 backgroundView로 초기화되어 얹어지게 되었지요.

엄밀히 따지면 세로 줄무늬는 칼라가 아닙니다. 이에 따라 애플이 명확하게 선을 긋기 위해 제거한 것 같습니다.
이로 인해 테이블의 backgroundView에 줄무늬가 얹어진 뷰로 대체되면서 그 밑에 숨어있는 테이블 백그라운드 칼라는 보이지 않게 되었습니다.

따라서 테이블의 백그라운드뷰를 투명한 뷰로 대체시키면 그 밑에 있는 테이블의 배경색을 볼 수 있게 되는 원리로 위와 같은 소스를 작성하시면 기존의 그림2처럼 사용하실 수 있게 됩니다.

2-9
그림2
big sponsors may find it hard to break up with the nflWhen the teams lined up again for fourth down, New England got new life when Baltimore was called for holding, giving it a fresh set of downs. Brady found Jabar Gaffney in the end zone and cheap china jerseys that was the game. Over the past month, having added the Rugby Channel (briefly, to watch the Australia England game) and paid for the $60 Joseph Parker Andy Ruiz WBO title fight, I’ve handed Sky TV around $200. TWO HUNDRED DOLLARS. A number of key factors contributed to 17% year on year EBITDA growth from 7% increase in revenue. Our film segment more than doubled its quarterly earnings contribution, thanks to key film releases as well as the sale of some SVOD television rights. Enter your information into the check printing program, and print out a sample check using the MICR toner and laser stock paper. Make sure all the information, including routing number, account number, name and address, bank address and name, all match your original check from the bank. 5d1 d2). (a1 a2) Spatial IOS image sequence averaged over 100 frames (1,000 ms interval) with 10 ms stimulation and 500 ms stimulation. “Xbox 360 has been a leader in delivering entertainment experiences for years, with over 170 global entertainment apps and experiences available today. We’re constantly adding new partners and experiences to the growing catalog on Xbox One. Wholesale NFL Jerseys Samsung I8000 Omnia II Black casing is 117 grams in weight and its measurements are compact making it a pocket friendly handset which is 11.8cm tall by 5.96cm wide by 1.19cm deep. The Samsung I8000 Omnia II Black is from the same Samsung cheap nfl jerseys family as the Samsung i8900 Omnia Black and the Samsung i8910 Omnia HD. He knows how to play like an old school front rower where they charge into them and carry blokes and get good play the balls which is pretty good wholesale nfl jerseys these days.[There is no extra motivation] because there is a no.1 prop on the line. It’s just because he is the opposite front rower and I want to try and play better than him. Mysterious growthA 2015 study2 found that much of the main Taupo Volcanic Zone was subsiding, or sinking, as is expected after magma erupts and drains from an underground chamber. But one area, to the north and west along the Bay of Plenty coast, seemed to be rising. Andrew Luck seems like a good pick here, but it depends on which Luck you get. If cheap jerseys it’s the one cheap nfl jerseys that played last year before the injury, it could be a long season for the Stomp. Now I was only half kidding about the Eagles picking either the next Donovan McNabb or the next Ryan Leaf. Both McNabb (in 1999) and Leaf (in 1998) were the wholesale nfl jerseys second pick of their respective drafts.

Published by

안반장

Web과 App 개발을 하고 있으며 최근 워드프레스에 관심이 많아져 네이버 카페 워드프레스 홈페이지의 TF팀으로 활동 중 입니다.개인적으로는 안반장의 개발 노트라는 블로그를 운영하면서 개발의 즐거움과 고충들을 차곡차곡 담아가고 있습니다.