WPF TextBlock 文本换行与行间距


换行符:
C#代码中:\r\n 或  \r 或 \n     
XAML中:
 或 
注:\r 回车 (carriage return 缩写),\n 新行 (new line 缩写)。
 
行间距:
LineHeight属性
 
示例:
<TextBlock LineHeight="30" Text=" 第一行 &#x0A; 第二行"/>
<TextBlock LineHeight="30" Text=" 第一行 &#x0D; 第二行"/>
 
\r与\n的区别:

\r :到当前行的最左边。
\n:向下移动一行,并不移动左右。
Linux中:\n表示回车+换行;
Windows中:\r\n表示回车+换行。
Mac中:\r表示回车+换行。

<!--index.wxml--> <scroll-view class="container" scroll-y="true" scroll-into-view="{{toView}}"  scroll-top="{{scrollTop}}" bindscroll="scroll"> <swiper indicator-dots="{{indicatorDots}}"   autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" class="swiper-box" id="top">   <block wx:for-items="{{banner_list[0].banner}}" wx:key="index">     <swiper-item >       <image class="slide-image" src="{{item.pic_url}}"/>     </swiper-item>   </block> </swiper>  <view>   <view class='menueview' >    <block wx:for-items="{{banner_list[1].banner}}" wx:key="index">      <view  class="menue-1">         <view class="menueimg">             <image src="{{item.pic_url}}" class="menue-image" />         </view>         <view class="menuetext">{{item.title}}</view>     </view>    </block>   </view>  </view> <view class='hg-container' id="new" >   <text class="hg-title">新品推荐</text>         <view class='gooditem'>             <view class='imgview' wx:key="index"  wx:for="{{newgoods}}" wx:for-index="idx" wx:for-item="good">               <image class='productimg' src='/images/icons/1.webp'/>             </view>         </view> </view> <view class='hg-container'>   <text class="hg-title">超值买</text>         <view class='gooditem'>             <view class='imgview' wx:key="index"  wx:for="{{newgoods}}" wx:for-index="idx" wx:for-item="good">               <image class='productimg' src='/images/icons/2.webp'/>             </view>         </view> </view> <view class='hot-container'>   <view class="hot-title">食惠购</view>         <view class='hot-gooditem'>             <view class='hot-imgview' wx:key="index"  wx:for="{{hotgoods}}" wx:for-index="idx" wx:for-item="hot">               <image class='hot-product' src='{{hot.more_pic}}'/>             </view>         </view> </view> <view class="footer" bindtap="tap">   <view>   <text>沪ICP备888888888号</text>   <text>htmlk.cn</text>   <text>微信商城有限公司</text>   <text>北京市xxxxxxxxx</text>   </view> </view> </scroll-view>
06-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值