찾다
위챗 애플릿미니 프로그램 개발미니 프로그램 개발 DEMO 사례

WeChat 미니 프로그램 레이아웃 예시:

다음 순서대로 소개합니다.

레이아웃 구현
로직 구현
스타일 구현

1. 레이아웃 구현

뷰 레이아웃에는 그림, 텍스트 설명, 정보 표시줄 및 구분선

<!--最外层-->
<view class="home-view1">
  <!--图片层-->
  <view class="home-view2">
    <image class="home-image1" src="http://qty83k.creatby.com/materials/origin/640e31829b8776967dedc670b5427d0f_origin.jpg"></image>
  </view>
  
  <!--描述层-->
  <text class="home-text1">小巧可爱的案头雅物小巧可爱的案头雅物小巧可爱的案头雅物小巧可爱的案头雅物小巧可爱的案头雅物</text>
  
  <!--信息层-->
  <view class="home-view3">
    <view class="home-view4" >
      <image class="home-image-heart" src="http://qty83k.creatby.com/materials/origin/c5656ef00d38d89eae437c5a9102f8fa_origin.png"></image>
  
      <text class="home-text-heart bgColor" > 22</text>
    </view>
    <text class="home-text-time" >2016.10.29</text>
  </view>
  
  <!--分界线line-->
  <view class="home-view-line"></view>
  
  <!--图片层(下面的代码直接复制了上面的所有布局代码)-->
  <view class="home-view2">
    <image class="home-image1" src="http://qty83k.creatby.com/materials/origin/640e31829b8776967dedc670b5427d0f_origin.jpg"></image>
  </view>
  
  <!--描述层-->
  <text class="home-text1">小巧可爱的案头雅物小巧可爱的案头雅物小巧可爱的案头雅物小巧可爱的案头雅物小巧可爱的案头雅物</text>
  
  <!--信息层-->
  <view class="home-view3">
    <view class="home-view4" >
      <image class="home-image-heart" src="http://qty83k.creatby.com/materials/origin/c5656ef00d38d89eae437c5a9102f8fa_origin.png"></image>
  
      <text class="home-text-heart bgColor" > 22</text>
    </view>
    <text class="home-text-time" >2016.10.29</text>
  </view>
  
  <!--分界线line-->
  <view class="home-view-line"></view>
  
</view>

이 포함됩니다. 구현

은 페이지 인터페이스

Page({
  
  data:{
  
  }
  
})

를 등록합니다. 3. 스타일 구현

.home-view1 스타일: display는 최대 뷰 레이아웃을 지정합니다. 유연한 레이아웃, 단지ify-content가 콘텐츠가 중앙에 있고 수직으로 정렬되도록 지정하는 경우 ...

.home-view3 스타일: 디스플레이는 정보 표시줄 레이아웃이 유연한 레이아웃임을 지정합니다. , justify-content는 콘텐츠가 수평으로 고르게 분포되도록 지정합니다.

.home-view4 스타일: display는 컬렉션 사진과 컬렉션 번호의 상위 레이아웃이 유연한 레이아웃임을 지정하고 align-items는 콘텐츠가 중앙에 정렬되도록 지정합니다. 수직

.home- image1 스타일: 이미지의 높이를 지정

.home-image-heart 스타일: 수집된 이미지의 크기를 지정

.home-text1 style: 설명 텍스트의 스타일을 지정합니다. text-align 텍스트를 가운데로 지정합니다. line-height텍스트 두 줄 사이의 높이를 지정합니다

. home-text-heart 스타일: 컬렉션 번호의 스타일을 지정합니다. border-radius는 테두리 필렛을 지정합니다

.home-view-line 스타일: 구분선

.bgColor 스타일: 컬렉션 번호의 배경 지정

.home-view1{
  display: flex;
  justify-content: center;
  flex-direction: column;
  
  height: 100%;
  width: 100%;
  margin: 6px;
  
}
  
.home-view3{
  display: flex;
  justify-content: space-between;
}
  
.home-view4{
  display: flex;
  align-items: center;
}
  
.home-image1{
  height: 200px;
}
  
.home-image-heart{
  width: 30px;
  height: 30px;
}
  
.home-text1{
  text-align: left;
  line-height: 25px;
  margin-top: 6px;
  margin-right: 6px;
  color: gray;
}
  
.home-text-heart{
  width: 22px;
  height: 22px;
  margin-left: 10px;
  border-radius: 20%;
  pad: 5px;
  text-align: center;
}
  
.home-text-time{
  text-align: center;
  margin-right: 20px;
  padding-top: 5px;
  color: gray;
}
  
.home-view-line{
  
 width: 100%;
 height: 6px;
 margin-top: 5px;
 background-color: gainsboro;
}
  
.bgColor{
  background-color: lightblue;
  opacity: 0.6;
}

【 관련 추천】

1. WeChat 미니 프로그램 전체 소스 코드 다운로드

2. WeChat 미니 프로그램 학습 데모: 채팅방 + 오디오 및 비디오 + 콘텐츠 추가

위 내용은 미니 프로그램 개발 DEMO 사례의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

Video Face Swap

Video Face Swap

완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

뜨거운 도구

안전한 시험 브라우저

안전한 시험 브라우저

안전한 시험 브라우저는 온라인 시험을 안전하게 치르기 위한 보안 브라우저 환경입니다. 이 소프트웨어는 모든 컴퓨터를 안전한 워크스테이션으로 바꿔줍니다. 이는 모든 유틸리티에 대한 액세스를 제어하고 학생들이 승인되지 않은 리소스를 사용하는 것을 방지합니다.

ZendStudio 13.5.1 맥

ZendStudio 13.5.1 맥

강력한 PHP 통합 개발 환경

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

VSCode Windows 64비트 다운로드

VSCode Windows 64비트 다운로드

Microsoft에서 출시한 강력한 무료 IDE 편집기

MinGW - Windows용 미니멀리스트 GNU

MinGW - Windows용 미니멀리스트 GNU

이 프로젝트는 osdn.net/projects/mingw로 마이그레이션되는 중입니다. 계속해서 그곳에서 우리를 팔로우할 수 있습니다. MinGW: GCC(GNU Compiler Collection)의 기본 Windows 포트로, 기본 Windows 애플리케이션을 구축하기 위한 무료 배포 가능 가져오기 라이브러리 및 헤더 파일로 C99 기능을 지원하는 MSVC 런타임에 대한 확장이 포함되어 있습니다. 모든 MinGW 소프트웨어는 64비트 Windows 플랫폼에서 실행될 수 있습니다.