2014-12-16 4 views
0

안녕 내가 문자열 와 안드로이드에서 아랍어 텍스트 뷰 싶습니다 그리고 난 난이 방법을 시도하지만, 일을 해달라고 ... و 붉은 색을 싶습니다 **아랍어 알파벳

TextView txt = (TextView) findViewById(R.id.txt); 
String mainText = "صَدَقَ الله"; 
     String fatha = "َ"; 
     String htmlText = mainText.replaceAll(fatha,<fontcolor='#c5c5c5'>\u064F</font>"); 
    txt.setText(Html.fromHtml(htmlText)); 

plese 도움이 나에게

답변

0

크레아 res 아래에 새 폴더를 만들고 values-ar을 호출하여 그 안에 strings.xml을 만듭니다.

원하는 단어를 추가하십시오.

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
<string name="tt">صَدَقَ الله</string> 
</resources> 

후, 된 setContentView 전에이 코드()

Locale locale = new Locale("ar"); 
Locale.setDefault(locale); 
Configuration config = new Configuration(); 
config.locale = locale; 
getApplicationContext().getResources().updateConfiguration(config, null); 

호출 지금 이름으로 해당 문자열을 추가합니다. 희망이 도움이

+0

하지만이 코드는 작동하지 않습니다 – shazde2025

+0

그것은 게시하기 전에 그것을 시도했습니다. 어떻게했는지 보여주세요! –