android 特殊符号显示


单引号 '    '


   "          "


   >    >


   <    &lt;


   &   &amp;
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Android中的特殊符号通常可以通过在drawable资源文件中创建矢量图形来实现。以下是一些常见特殊符号的示例: 1. 向上箭头:可以使用`path`元素在drawable资源文件中创建一个向上的箭头。例如: ```xml <vector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; android:width=&quot;24dp&quot; android:height=&quot;24dp&quot; android:viewportWidth=&quot;24.0&quot; android:viewportHeight=&quot;24.0&quot;> <path android:fillColor=&quot;#000&quot; android:pathData=&quot;M12,5l-5,5h3v4h4v-4h3l-5,-5zm0,10l5,-5h-3v-4h-4v4h-3l5,5z&quot;/> </vector> ``` 2. 向下箭头:可以使用`path`元素在drawable资源文件中创建一个向下的箭头。例如: ```xml <vector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; android:width=&quot;24dp&quot; android:height=&quot;24dp&quot; android:viewportWidth=&quot;24.0&quot; android:viewportHeight=&quot;24.0&quot;> <path android:fillColor=&quot;#000&quot; android:pathData=&quot;M12,19l5,-5h-3v-4h-4v4h-3l5,5zm0,-14l-5,5h3v4h4v-4h3l-5,-5z&quot;/> </vector> ``` 3. 向左箭头:可以使用`path`元素在drawable资源文件中创建一个向左的箭头。例如: ```xml <vector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; android:width=&quot;24dp&quot; android:height=&quot;24dp&quot; android:viewportWidth=&quot;24.0&quot; android:viewportHeight=&quot;24.0&quot;> <path android:fillColor=&quot;#000&quot; android:pathData=&quot;M14,18l-5,-5 5,-5v3h4v4h-4z&quot;/> </vector> ``` 4. 向右箭头:可以使用`path`元素在drawable资源文件中创建一个向右的箭头。例如: ```xml <vector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; android:width=&quot;24dp&quot; android:height=&quot;24dp&quot; android:viewportWidth=&quot;24.0&quot; android:viewportHeight=&quot;24.0&quot;> <path android:fillColor=&quot;#000&quot; android:pathData=&quot;M10,18l5,-5 -5,-5v3h-4v4h4z&quot;/> </vector> ``` 你可以将以上示例代码复制到一个名为 `arrow.xml` 的 drawable资源文件中,然后在应用中使用它们。例如,可以使用以下代码在ImageView中显示向上箭头: ```xml <ImageView android:layout_width=&quot;wrap_content&quot; android:layout_height=&quot;wrap_content&quot; android:src=&quot;@drawable/arrow&quot;/> ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值