-1
A
回答
2
这里是你的自定义绘制custom_shape_down_arrow.xml
:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Background -->
<item>
<shape android:shape="rectangle">
<size
android:width="250dp"
android:height="20dp" />
<solid android:color="#cdcdcd" />
</shape>
</item>
<!-- Top-Left Line -->
<item
android:right="150dp"
android:bottom="18.7dp">
<shape android:shape="line">
<stroke
android:color="#999999"
android:width="1dp" />
</shape>
</item>
<!-- Top-Right Line -->
<item
android:left="150dp"
android:bottom="18.7dp">
<shape android:shape="line">
<stroke
android:color="#999999"
android:width="1dp" />
</shape>
</item>
<!-- Left-Diagonal Line -->
<item
android:right="25dp">
<rotate android:fromDegrees="36">
<shape android:shape="line">
<stroke
android:color="#999999"
android:width="1dp" />
</shape>
</rotate>
</item>
<!-- Right-Diagonal Line -->
<item
android:left="27dp">
<rotate android:fromDegrees="322">
<shape android:shape="line">
<stroke
android:color="#999999"
android:width="1dp" />
</shape>
</rotate>
</item>
</layer-list>
用途:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="24dp"
android:gravity="center_horizontal">
<!-- Custom shape -->
<LinearLayout
android:id="@+id/layout_custom_shape"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:paddingTop="10dp"
android:background="#cdcdcd">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/custom_shape_down_arrow">
</LinearLayout>
</LinearLayout>
</LinearLayout>
OUTPUT:
希望这会有所帮助〜
+0
它的工作原理。谢谢 – user2817947
+0
很高兴知道。如果我的回答看起来有用,那么请将它投票。谢谢... – FAT
相关问题
- 1. 如何用箭头指向右方创建标签结构
- 2. 如何在右侧的指示框上指示箭头指向左侧的焦点区域?
- 3. 如何使用matplotlib创建弯曲(左或右) - 箭头?
- 4. 带边框的CSS箭头
- 5. 如何绘制带边框的箭头?
- 6. (向下)带CSS的箭头框
- 7. MSysGit Bash - 如何启用Ctrl +向左/向右箭头?
- 8. 如何创建一个带有白色背景,带有三角形箭头的灰色边框的布局 - Android
- 9. 带左右箭头的水平回收站视图指标
- 10. CSS:如何创建一个按钮,右边的箭头placedo
- 11. 如何在Android导航中显示指向目标的箭头?
- 12. 在jquery中切换右箭头向下箭头[accordion-like]
- 13. 如何使用简单的css创建uparrow向下箭头
- 14. UIScrollView在IOS中的左右箭头
- 15. 如何用右箭头在div上添加白色边框?
- 16. 如何接受Linux shell中的左/右/上/下箭头输入?
- 17. 如何使TextField右侧的数据类型指示器在单击左侧或右侧箭头键时消失?
- 18. 使用左右箭头更改图像
- 19. 幻灯片不显示左/右箭头
- 20. 如何获取活动上的右/左箭头以指示右侧/左侧有更多屏幕?
- 21. 如何在Android中创建带有边框的表格?
- 22. CSS3菜单边框 - 右箭头效果
- 23. 带有箭头和边框的CSS工具提示
- 24. Android:如何使用可点击的箭头在右侧创建自定义EditText
- 25. 没有显示右箭头
- 26. 使用css向右边框和左边框倾斜
- 27. 如何在Android ListView上放置箭头指示器指针
- 28. 带箭头边框的图像按钮
- 29. CSS面包屑箭头指向左
- 30. 想改变向上和向下箭头样式到的NumericStepper左,右箭头样式在Flex 3的
你需要什么目的? –
您可以尝试使用9个补丁的图像背景。 –
我想创建一个带查看寻呼机的滑块,选定的选项卡将指示另一个视图。向下箭头将指示已启用的视图,并且该行的其余部分将遍布禁用的视图并希望使用xml进行创建。 – user2817947