首页
\
问答
\
如何在Android xml drawables中绘制带圆角的线条(How to draw Line with rounded corners in Android xml drawables)
如何在Android xml drawables中绘制带圆角的线条(How to draw Line with rounded corners in Android xml drawables)
我想在带有圆角的
XML
绘制一条线。我没有得到如何创建它。我想将此行用于Seekbar
。 我想像矩形那样为线条提供圆角。<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background"> <shape android:shape="line"> <stroke android:width="5dp" android:color="#7b7878" /> </shape> </item> <item android:id="@android:id/progress"> <clip> <shape android:shape="line"> <stroke android:width="5dp" android:color="#FF0000" /> </shape> </clip> </item>
I want to draw a line in the
XML
with rounded corners.I am not getting how to create that.I want to use this line for theSeekbar
. I want to give rounded corners to the line just like rectangle.<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background"> <shape android:shape="line"> <stroke android:width="5dp" android:color="#7b7878" /> </shape> </item> <item android:id="@android:id/progress"> <clip> <shape android:shape="line"> <stroke android:width="5dp" android:color="#FF0000" /> </shape> </clip> </item>
原文:https://stackoverflow.com/questions/37762958
更新时间:2024-01-14 20:01
最满意答案
试试这样:
@font-face { font-family: 'dineng'; font-style: normal; font-weight: normal; src: url('fonts/dineng.eot'); src: url('fonts/dineng.eot?#iefix') format('embedded-opentype'), url('fonts/dineng.woff') format('woff'), url('fonts/dineng.ttf') format('truetype'), url('fonts/dineng.svg#dineng') format('svg'); }
否则,请打开计算机上的.TTF文件。 如果它已经显示为粗体,则字体将无法缩小,因为这是字体的正常外观。
Try it like this:
@font-face { font-family: 'dineng'; font-style: normal; font-weight: normal; src: url('fonts/dineng.eot'); src: url('fonts/dineng.eot?#iefix') format('embedded-opentype'), url('fonts/dineng.woff') format('woff'), url('fonts/dineng.ttf') format('truetype'), url('fonts/dineng.svg#dineng') format('svg'); }
Otherwise, open the .TTF file on your computer. If it already appears bold, the font WILL NOT be able to be decreased in size because that's the normal look for the font.
相关问答
更多-
您需要使用local指令来测试本地安装的字体版本。 如果未找到,则会测试列表中的下一个字体,并在可用时加载。 例如: @font-face { font-family: MyHelvetica; src: local("Helvetica Neue Bold"), local("HelveticaNeue-Bold"), url(MgOpenModernaBold.ttf); font-weight: bold; } 上面的例子来自这里: https://devel ...
-
你可以在样式表中使用这样的东西 @import url('https://fonts.googleapis.com/css?family=Roboto:400,400i,500,500i'); h2{ font-family:Roboto; } you can use like this in your stylesheet @import url('https://fonts.googleapis.com/css?family=Roboto:400,400i,500,500i'); h2{ font-f ...
-
跨浏览器@ font-face使用(Cross browser @font-face use)[2022-02-03]
试试这样: @font-face { font-family: 'dineng'; font-style: normal; font-weight: normal; src: url('fonts/dineng.eot'); src: url('fonts/dineng.eot?#iefix') format('embedded-opentype'), url('fonts/dineng.woff') format('woff'), ... -
@ font-face无效(@font-face not working)[2022-10-16]
就像你在这里看到的那样,为了在使用@font-face时实现crossbrowser成功,我们需要使用许多字体格式。 因此,将您的字体转换为eot , ttf和svg并显式使用以下格式: @font-face { font-family: 'ITC Kabel'; src: url('ITCKabel.eot'); src: local('ITC Kabel'), local('ITCKabel'), url('ITCKabel.ttf') f ... -
简答 使用local("Font Name")语法时,在字体名称周围加上引号。 说明 “Univers”在Edge和Firefox中都很好。 但是,您的“请登录...”元素的目标是“Univers Condensed”,只有在您使用带引号的local("Univers Condensed")时才会在Edge中呈现。 这可能是因为Edge比Firefox更严格。 MDN说...... 用于远程字体文件位置的src URL,或用户计算机上的local("Font Name") ,格式为local("Font N ...
-
将这些字体放在您自己的服务器上,它们将起作用。 Firefox无法外包字体。 Put those fonts on your own server and they will work. Firefox cannot outsource fonts.
-
@ font-face不工作3(@font-face not working 3)[2023-02-08]
这可能是因为你没有使用相对路径试试这个: @font-face { font-family: 'RM Typerighter old Regular'; src: url('./fonts/RM_Typerighter_old_Regular.woff2') format('woff2'), url('./fonts/RM_Typerighter_old_Regular.woff') format('woff'), url('./fonts/RM_Typerighter_ ... -
如果CSS崩溃你的浏览器我会很惊讶。 您创建的图标字体可能已损坏。 The problem appears to be directly with the IcoMoon App. After creating my Icon Font with IcoMoon i uploaded the ttf file with Font Squirrel's own generator and low and behold no browsers crashed and page load speed was 10 ...
-
jQuery有一个函数fontAvailable,你可以检查是否加载了fontface字体: $(document).ready(function() { if(!$.fontAvailable('FontFaceFontName')) { // Your Cufon Replace Code } }); jQuery has a function fontAvailable where you can check if the fontface font is loade ...
-
@ font-face根本不工作(@font-face not working at all)[2022-06-24]
我们无法找到另一种方式,因为看起来我们在亚马逊上的所有设置都很好。 相反,我们只是将字体定义本身嵌入到数据uri调用中,如下所示。 在StackOverflow中,大部分字体定义已被省略以限制答案的约束,但这应该可以让您对我们的方法有所了解。 @font-face { font-family: "PFDinTextPro-Light"; src: url("233cd7_2_0-webfont.eot"); } @font-face { font-family: "PFDinText ...