我有一个TextView,我想要的是制作TextView形状圆,然后根据我使用的不同条件设置不同的背景颜色.我可以根据不同的条件设置背景颜色,但不能制作TextView形状圆.那怎么可以做到.请帮我解决这个问题.
我用的代码是
TextView txt_stage_display = (TextView)findViewById(R.id.txt_stage_display);
if(m_enStage[position] == enSTAGE_START)
{
txt_stage_display.setBackgroundColor(Color.parseColor("#D48393"));
}
else if(m_enStage[position] == enSTAGE_FLOW)
{
txt_stage_display.setBackgroundColor(Color.parseColor("#D48393"));
}
else if(m_enStage[position] == enSTAGE_SAFE)
{
txt_stage_display.setBackgroundColor(Color.parseColor("#66B0CC"));
}
else if(m_enStage[position] == enSTAGE_UNSAFE)
{
txt_stage_display.setBackgroundColor(Color.parseColor("#D8C627"));
}
else if(m_enStage[position] == enSTAGE_FERTILE)
{
txt_stage_display.setBackgroundColor(Color.parseColor("#67A05E"));
}
else
{
txt_stage_display.setBackgroundColor(Color.parseColor("#808080"));
}
Run Code Online (Sandbox Code Playgroud) I want to show text with circular shape in my android application.I know it is done with custome textview but can some buddy give me proper code.I am also attaching image which type of look i want.
