feat: 메인 라이브
- 추천 라이브 배너 크기 조절
This commit is contained in:
@@ -16,24 +16,18 @@ struct SectionRecommendLiveView: View {
|
|||||||
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
|
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 28) {
|
||||||
TabView(selection: $currentIndex) {
|
TabView(selection: $currentIndex) {
|
||||||
ForEach(0..<items.count, id: \.self) { index in
|
ForEach(0..<items.count, id: \.self) { index in
|
||||||
let item = items[index]
|
let item = items[index]
|
||||||
if let url = item.imageUrl.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) {
|
if let url = item.imageUrl.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) {
|
||||||
KFImage(URL(string: url))
|
KFImage(URL(string: url))
|
||||||
.cancelOnDisappear(true)
|
.cancelOnDisappear(true)
|
||||||
.downsampling(
|
|
||||||
size: CGSize(
|
|
||||||
width: screenSize().width - 26.7,
|
|
||||||
height: (screenSize().width - 26.7) * 0.53
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.resizable()
|
.resizable()
|
||||||
.scaledToFill()
|
.scaledToFill()
|
||||||
.frame(
|
.frame(
|
||||||
width: screenSize().width - 26.7,
|
width: screenSize().width,
|
||||||
height: (screenSize().width - 26.7) * 0.53
|
height: screenSize().width * 0.53
|
||||||
)
|
)
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||||
@@ -46,17 +40,11 @@ struct SectionRecommendLiveView: View {
|
|||||||
} else {
|
} else {
|
||||||
KFImage(URL(string: item.imageUrl))
|
KFImage(URL(string: item.imageUrl))
|
||||||
.cancelOnDisappear(true)
|
.cancelOnDisappear(true)
|
||||||
.downsampling(
|
|
||||||
size: CGSize(
|
|
||||||
width: screenSize().width - 26.7,
|
|
||||||
height: (screenSize().width - 26.7) * 0.53
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.resizable()
|
.resizable()
|
||||||
.scaledToFill()
|
.scaledToFill()
|
||||||
.frame(
|
.frame(
|
||||||
width: screenSize().width - 26.7,
|
width: screenSize().width,
|
||||||
height: (screenSize().width - 26.7) * 0.53
|
height: screenSize().width * 0.53
|
||||||
)
|
)
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||||
@@ -71,10 +59,9 @@ struct SectionRecommendLiveView: View {
|
|||||||
}
|
}
|
||||||
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
|
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
|
||||||
.frame(
|
.frame(
|
||||||
width: screenSize().width - 26.7,
|
width: screenSize().width,
|
||||||
height: (screenSize().width - 26.7) * 0.53
|
height: screenSize().width * 0.53
|
||||||
)
|
)
|
||||||
.padding(.top, 26.7)
|
|
||||||
|
|
||||||
HStack(spacing: 4) {
|
HStack(spacing: 4) {
|
||||||
ForEach(0..<items.count, id: \.self) { index in
|
ForEach(0..<items.count, id: \.self) { index in
|
||||||
@@ -87,9 +74,8 @@ struct SectionRecommendLiveView: View {
|
|||||||
.tag(index)
|
.tag(index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(.top, 13.3)
|
|
||||||
}
|
}
|
||||||
.frame(width: screenSize().width - 26.7)
|
.frame(maxWidth: .infinity)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
timer = Timer.publish(every: 3, on: .main, in: .common).autoconnect()
|
timer = Timer.publish(every: 3, on: .main, in: .common).autoconnect()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user