首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

android 控件应用集锦

2012-08-22 
android 控件使用集锦layout.xmlRadioGroup android:id@+id/sex style@style/textInfo androidRa

android 控件使用集锦

layout.xml

<RadioGroup android:id="@+id/sex" style="@style/textInfo" android><RadioButton android:text="男:" android:id="@+id/radionBtn_man" ></RadioButton><RadioButton android:text="女:" android:id="@+id/radionBtn_woman" ></RadioButton></RadioGroup>
?
RadioButton rb = (RadioButton) findViewById(sexRadioGroup.getCheckedRadioButtonId());mUser.setSex(((RadioButton) findViewById(sexRadioGroup.getCheckedRadioButtonId())).getText().toString());
?

?


<RadioGroup android:id="@+id/sex" style="@style/textInfo" android:orientation="vertical">

其中的android:orientation="vertical" 是设置group中的布局水平还是垂直,默认是垂直
android:checked="true" 标示默认选中

ps:如果多个radiobutton都有android:checked="true",则选中最后一个mTempPath.moveTo(50, 200);
mTempPath.quadTo(52, 10, 60, 200);
mTempPath.close();mTempPath.setFillType(FillType.EVEN_ODD);

mPaint.setStyle(Style.FILL);
mCanvas.drawPath(mTempPath, mPaint);</pre>
<p>?填充<span style="white-space: pre;">close()之后自动把path路径封闭了</span></p>
<p>?</p>

热点排行