简体   繁体   English

无法增加TextView上字符的边框宽度

[英]Unable to increase border width of characters on textview

I am trying my best increasing border width of characters on textview but i haven't founded anything like following. 我正在尽力增加textview上字符的边框宽度,但是我还没有建立如下的东西。 As you can see, outlined borders are black in order to constrast with backgrounds. 如您所见,轮廓边框为黑色,以与背景形成鲜明对比。 So, how can i do something like that? 那么,我该怎么做呢? I mean, i would like to do this with .xml or .java 我的意思是,我想用.xml或.java做到这一点

Outlined black 黑色轮廓

在此处输入图片说明

You can download the font type and add it to the items you need 您可以下载字体类型并将其添加到所需的项目中

https://i.stack.imgur.com/i6XNU.png

Select File / New Folder / Assets Folder 选择文件/新文件夹/资产文件夹

Right click on assets and create a folder called fonts 右键单击资产并创建一个名为fonts的文件夹

Put your font file in assets > fonts 将字体文件放入资源 > 字体

Use this 用这个

    TextView myTextView = (TextView) findViewById(R.id.textView);
    Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/yourfont.ttf");
    myTextView.setTypeface(typeface);

You can set shadow for your textview using attributes below. 您可以使用以下属性为textview设置阴影。

android:shadowColor="@color/black"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="2"

For more information link 有关更多信息链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM