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

[Style] 컴포넌트 부착 #52

Open
wants to merge 15 commits into
base: juri
Choose a base branch
from

Conversation

hooni0918
Copy link
Collaborator

🔗 연결된 이슈

📄 작업 내용

  • 바텀 컴포넌트를 만들었습닏다
구현 내용 IPhone 15 pro IPhone SE
GIF

💻 주요 코드 설명

  • 어쩌구저쩌구
import SwiftUI

struct PlaceCardsContainer: View {
    let places: [CardPlace]
    @Binding var currentPage: Int
    
    var body: some View {
        TabView(selection: $currentPage) {
            ForEach(Array(places.enumerated()), id: \.element.id) { index, place in
                PlaceCard(
                    placeName: place.name,
                    visitorCount: place.visitorCount,
                    address: place.address,
                    images: place.images,
                    title: place.title,
                    subTitle: place.subTitle,
                    description: place.description
                )
                .padding(.horizontal, 16)
                .tag(index)
            }
        }
        .frame(height: 280)
        .tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
    }
}

#Preview {
 Home()
}

탭뷰 스타일로 구현했습니다.
해당 코드를 가져다가 사용하기만 하면 됩니다.

👀 기타 더 이야기해볼 점

지오메트리 힘들다

@hooni0918 hooni0918 added style UI개발시 사용 Jihoon 나는지훈 labels Jan 15, 2025
@hooni0918 hooni0918 self-assigned this Jan 15, 2025
@hooni0918 hooni0918 changed the title Style/#45 map resturant components [Style] 컴포넌트 부착 Jan 15, 2025
import SwiftUI

struct PlaceCardsContainer: View {
let places: [CardPlace]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

외부에서 안쓰면 private 하세요.

ForEach(0..<pageCount, id: \.self) { index in
Circle()
.fill(currentPage == index ? Color.spoonBlack : Color.gray500)
.frame(width: 6, height: 6)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjust

.tag(index)
}
}
.frame(height: 280)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjust

.resizable()
.scaledToFill()
.frame(maxWidth: .infinity)
.frame(height: 132)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjust

.resizable()
.scaledToFill()
.frame(maxWidth: .infinity)
.frame(height: 132)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjust

.resizable()
.scaledToFill()
.frame(maxWidth: .infinity)
.frame(height: 132)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjust

Copy link
Collaborator

@ChoiAnYong ChoiAnYong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!

Copy link
Member

@thingineeer thingineeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생 하셨습니다.

Copy link
Collaborator

@juri123123 juri123123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생핑

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Jihoon 나는지훈 style UI개발시 사용
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Style] 바텀레이어 UI 제작
4 participants