Android高级UI ImageView ImageButton RadioButton CheckBox ProgressBar属性和用法总结

来源:互联网 发布:intelj java.util.map 编辑:程序博客网 时间:2024/04/30 09:55
高级UI
ImageView  ImageButton  RadioButton  CheckBox  ProgressBar  
1.ImageView 图片组件
src 指定要加载的图片
缩放问题
1.按着图片原始比例(不失真)
2.不按着比例(失真)
ScaleType
1.fitXY   强制让图片缩放以填充整个imageview
2.fitCenter  按着比例缩放以居中显示图片
3.fitEnd     按着比例缩放以局下部显示图片
4.fitStart   按着比例缩放以居上部显示图片
adjustViewBounds  图片边界和imageview边界契合


23code


2.ImageButton(没人用)
继承ImageView 属性都可以用


3.ProgressBar 进度条
样式:旋转进度条(不显示进度)  水平进度条(显示)


style  控制样式
1.@android:style/Widget.ProgressBar.Inverse  旋转
2.@android:style/Widget.ProgressBar.Horizontal 水平

3.max   水平进度条  总的进度值
4.progress 水平进度条 当前进度值
5.secondaryProgress 水平进度条 当前二级进度值

4.RadioButton(选项)
RadioGroup(单选框)
<RadioGroup >
<RadiButton />
<RadiButton />
<RadiButton />
</RadioGroup>

1.radiobutton
1.text   单选按钮旁边的提示文字
2.checked  默认情况是否选中
3.style   切换样式
@android:style/Widget.Holo.CompoundButton.CheckBox 方框选择
@android:style/Widget.Holo.CompoundButton.RadioButton圆圈(默认)

@android:style/Widget.Holo.CompoundButton.Star 五角星


0 0
原创粉丝点击