android - 无法在android应用程序中将文本从英语转换为印地语
问题描述
我正在构建一个应用程序,它从arraylist 中搜索名称并显示我们在edittext 中搜索的结果。我的arraylist 包含印地语字体的名称,我想在edittext 中使用默认的英文字体。同样在下面我保留了textview,它必须显示我在edittext中输入的印地语文本。看我的代码:
Typeface hindi = Typeface.createFromAsset(getAssets(),"fonts/hindifont.ttf"); textview.setText(edittext.getText().toString()); textview.setTypeface(hindi);
但它没有在 textview 中显示印地语字体,而是在 edittext 中显示英语。
解决方案
推荐阅读
- image-processing - 从具有两种不同帧率的视频中获取匹配的图像帧
- javascript - 为什么当我用 javascript 编写代码时,'const' 总是在 vim 中突出显示
- mysql - Laravel - DB::TABLE SQL - 如何在一个查询中获取连接数据
- python - 通过 Pyhon click 根据指定选项 Key 调用方法
- java - Opentelemetry Java 自动检测数据到 Jaeger
- python - Plotly:如何用观测值和回归线之间的线显示回归误差?
- scala - 如何从某种类型定义的对象中获取隐式读取?
- javascript - 录制音频然后播放
- php - 如何设置不同的角色并添加新角色
- c# - 我将如何在 C# 中对这些序列化/反序列化方法进行单元测试?