学做小程序(学堂在线笔记)

一、传统布局

text-align:center //水平居中 margin-bottom: 60px //设置间距

二、弹性盒子布局

display:flex;  flex-direction: column;  justify-content: space-around;   align-items: center;

三、元素大小适配不同屏幕
仅对iphone6:

.about-banner{  width: 187.5px;  height:187.5px;}

改进后

.about-banner{  width: 375rpx;  height:375rpx;}

加粗:

style='font-weignt:bold;font-size=60rpx;'

使用navigator组件:

<view>  <navigator   style = 'display:inline;'//消除换行符  url = '/pages/weekly/weekly' //设置链接  open-type='redirect'>每周推荐</navigator>//open-type设置是否允许返回  </view>

四:添加标签栏

  • 配置tabBar






  • ·SHARE·
    某985工科男,待业IT狗有一点温度,也有一点理性;有一点有趣,也有一点认真。写一些心得,偶尔也分享一些资源微信公众号:程序猿的进阶

    TAG标签: 微信小程序微信小程序大赛

    http://www.xiaochengxub.com/read-106999.html