我正在开发一个涉及一些希腊语和数学角色的应用程序。我已经尝试了一段时间将它们渲染到我的XML中,但我不知道我做错了什么,因为我已经使用unicode看起来很糟糕的字符串,class SysMsg
{
const ACTION_IGNORE = 0;
const ACTION_PROCESS = 1;
protected $action;
protected $message;
public function __construct($action = self::ACTION_IGNORE, $message = null)
{
$this->action = $action;
$this->message = $message;
}
public function getAction () { return $this->action; }
public function getMessage() { return $this->message; }
}
class SysMsg_AttackEnd extends SysMsg
{
protected $player;
public function __construct($player)
{
parent::__construct(SysMsg::ACTION_IGNORE, "");
$this->player = $player;
}
public function getMessage()
{
return '<b>' . $this->player['nickname'] . '</b> ends their attack.';
}
}
private function stageAction($type, $actions)
{
switch($type)
{
case 'attack_end':
$msg = new SysMsg_AttackEnd(active_player());
break;
}
if (isset($msg) && $msg->getAction() == SysMsg::ACTION_IGNORE)
{
$this->game['sys_msg'] = $msg;
$this->broadcastSysMsg();
}
}
,{{1甚至尝试了另一种字体
这些是未正确显示的字母:β,μ,σ和ω
这是我的测试版XML:
Html.fromHtml
strings.xml
等于<Button
android:id="@+id/btn_beta"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/special_chars_background"
android:text="@string/beta"
android:textColor="@color/black"
android:textSize="21sp" />
且看起来像普通资本@string/beta
你能帮我吗?提前谢谢。
答案 0 :(得分:1)
试试这个:添加android:textAllCaps =&#34; false&#34;在Button属性
中 <Button
android:id="@+id/btn_beta"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/special_chars_background"
android:text="@string/beta"
android:textAllCaps="false"
android:textColor="@color/black"
android:textSize="21sp" />
string.xml中的将此字符串
<string name="beta">β</string>