【kubernetes 源码详解】【坐标指标源码】【cms源码教程】android wether 源码

2024-12-23 07:15:24 来源:雕刻路径源码 分类:热点

1.switchermod怎么用

android wether 源码

switchermod怎么用

       一、各自的功能及使用场景

       ImageView:用于展示一张,例如商品展示;

       Switch:开关、kubernetes 源码详解控制器,常用于app设置中;

       DatePicker:日期选择器,坐标指标源码多用于订阅类的cms源码教程服务和功能

       二、简单使用

       1、布局部分

xml version="1.0" encoding="utf-8"?LinearLayout xmlns:android="/apk/res/android" xmlns:app="/apk/res-auto" xmlns:tools="/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" android:gravity="center" android:orientation="vertical" ImageView android:id="@+id/iv_img" android:layout_width="dp" android:layout_height="dp" / Button android:id="@+id/btn_todo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="CLICK"/ Switch android:id="@+id/s_toggle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:checked="true"/ TextView android:id="@+id/tv_date" android:layout_width="wrap_content" android:layout_height="wrap_content"/ DatePicker android:id="@+id/dp_date" android:layout_width="wrap_content" android:layout_height="wrap_content" //LinearLayout

       code>

       2、代码部分

       private TextView tvDate; private Button btnTodo; private Switch sToggle; private DatePicker dpDate; private ImageView ivImg; @Override protected void onCreate(Bundle savedInstanceState) private void setListener() ); sToggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() }); if (Build.VERSION.SDK_INT = Build.VERSION_CODES.O) }); } } private void initView() }

       code>

       代码中,我通过sToggle来控制btnTodo是否可点击,将dpDate获取到的日期用tvDate展示,之所以会+1是因为月份获取到的数字是从0开始的

       三、运行效果

       四、cpu源码翻译官网对于上述控件的属性介绍

       1、ImageView

       android:adjustViewBounds

       Set this 公司源码泄密to true if you want the ImageView to adjust its bounds to preserve the aspect ratio of its drawable.

       android:baseline

       The offset of the baseline within this view.

       android:baselineAlignBottom

       If true, the image view will be baseline aligned with based on its bottom edge.

       android:cropToPadding

       If true, the image will be cropped to fit within its padding.

       android:maxHeight

       An optional argument to supply a maximum height for this view.

       android:maxWidth

       An optional argument to supply a maximum width for this view.

       android:scaleType

       Controls how the image should be resized or moved to match the size of this ImageView.

       android:src

       Sets a drawable as the content of this ImageView.

       android:tint

       The tinting color for the image.

       android:tintMode

       Blending mode used to apply the image tint.

       2、Switch

       android:showText

       Whether to draw on/off text.

       android:splitTrack

       Whether to split the track and leave a gap for the thumb drawable.

       android:switchMinWidth

       Minimum width for the switch component.

       android:switchPadding

       Minimum space between the switch and caption text.

       android:switchTextAppearance

       TextAppearance style for text displayed on the switch thumb.

       android:textOff

       Text to use when the switch is in the unchecked/"off" state.

       android:textOn

       Text to use when the switch is in the checked/"on" state.

       android:textStyle

       Style (normal, bold, italic, bold|italic) for the text.

       android:thumb

       Drawable to use as the "thumb" that switches back and forth.

       android:thumbTextPadding

       Amount of padding on either side of text within the switch thumb.

       android:thumbTint

       Tint to apply to the thumb.

       android:thumbTintMode

       Blending mode used to apply the thumb tint.

       android:track

       Drawable to use as the "track" that the switch thumb slides within.

       android:trackTint

       Tint to apply to the track.

       android:trackTintMode

       Blending mode used to apply the track tint.

       android:typeface

       Typeface (normal, sans, serif, monospace) for the text.

       3、DatePicker

       android:calendarTextColor

       The text color list of the calendar.

       android:calendarViewShown

       Whether the calendar view is shown.

       android:datePickerMode

       Defines the look of the widget.

       android:dayOfWeekBackground

       The background color for the header's day of week.

       android:dayOfWeekTextAppearance

       The text color for the header's day of week.

       android:endYear

       The last year (inclusive), for example "".

       android:firstDayOfWeek

       The first day of week according to Calendar.

       android:headerBackground

       The background for the selected date header.

       android:headerDayOfMonthTextAppearance

       The text appearance for the day of month (ex.

       android:headerMonthTextAppearance

       The text appearance for the month (ex.

       android:headerYearTextAppearance

       The text appearance for the year (ex.

       android:maxDate

       The maximal date shown by this calendar view in mm/dd/yyyy format.

       android:minDate

       The minimal date shown by this calendar view in mm/dd/yyyy format.

       android:spinnersShown

       Whether the spinners are shown.

       android:startYear

       The first year (inclusive), for example "".

       android:yearListItemTextAppearance

       The list year's text appearance in the list.

       android:yearListSelectorColor

       The list year's selected circle color in the list.

       五、补充

       一般来讲,有什么属性,就有对应的set和get方法;另外对代码中的if语句块作个简单说明:它表示android版本大于等于8.0以上才执行if里的内容

更多资讯请点击:热点

推荐资讯

基隆市長謝國樑罷免案成立!10天內提答辯書 10/13舉行投票

基隆市市民戴璟安3/8發起「山海公民拆樑行動」,主意罷免基隆市市長謝國樑,中央選舉委員會今16)天舉行委員會議,審查通過此起罷免案已達法定連署人數,將於10/13週日)進行投票。中選會今天審查通過戴璟

看源码困难_看源码有什么用

1.如何才能看到exe的源代码2.初学者怎样看懂代码的方法3.怎么看源码?4.Windows内核原理讲解与实现方式解析:为何理解和阅读源代码困难?5.如何高效地查看开源项目源码?如何才能看到exe的源

饥荒源码解析_饥荒源码解析mod

1.【源码看饥荒】第二期 entity与prefab2.迷你世界抄袭我的世界是不是3.[饥荒控制台]饥荒控制台代码列表查看介绍_[饥荒控制台]饥荒控制台代码列表查看是什么4.进入饥荒出现【源码看饥荒】