1.switchermod怎么用
switchermod怎么用
一、各自的功能及使用场景
ImageView:用于展示一张,例如商品展示;
Switch:开关、盛记米线濮阳控制器,常用于app设置中;
DatePicker:日期选择器,职高吃米线多用于订阅类的濮阳炒米线服务和功能
二、简单使用
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" //LinearLayoutcode>
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开始的
三、运行效果
四、麒麟西路米线官网对于上述控件的属性介绍
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里的内容
大会通过了关于十九届中央纪律检查委员会工作报告的决议
1、没有区别只是“阖”字其中的一种用法和“合”相同阖家幸福多用于古代现代多用合家幸福。
本文到此分享完毕,希望对你有所帮助。
版权声明:本文由用户上传,如有侵权请联系删除!
" alt="阖家幸福是什么意思和含义(阖家幸福是什么意思)">阖家幸福是什么意思和含义(阖家幸福是什么意思)
三国历史知识:三国时期有哪些著名的组合?
1、上海一本大学有:复旦大学、上海交通大学、同济大学、华东师范大学、华东理工大学、东华大学、上海财经大学、上海外国语大学、上海海事大学、上海理工大学、华东政法大学、上海对外贸易学院、上海音乐学院、上海大学、上海中医药大学、上海师范大学。
2、上海二本大学有:上海交通大学、上海海事大学、上海理工大学、上海杉达学院、上海对外贸易学院、上海金融学院、上海海洋大学、上海电力学院、上海大学、上海中医药大学、上海应用技术学院、上海师范大学、上海工程技术大学、上海体育学院、上海立信会计学院、上海第二工业大学、上海商学院、上海电机学院、上海政法学院、上海外国语大学贤达经济人文学院、上海建桥学院、上海师范大学天华学院。
本文到此分享完毕,希望对你有所帮助。
版权声明:本文由用户上传,如有侵权请联系删除!
" alt="上海海洋大学是一本还是二本大学(上海海洋大学是一本还是二本)">上海海洋大学是一本还是二本大学(上海海洋大学是一本还是二本)
新理念新表达 用光影艺术展现行业之美——2023中国行业媒体短视频大赛最佳创意作品解读
热播大型古装剧《武媚娘传奇》掀起了一轮轮收视高潮,“百变范爷”在剧中将一代女皇武则天演绎得淋漓尽致。追剧的粉丝们在高呼过瘾的同时,不免生出疑问:武媚娘是在怎样的熏陶下,顶着男权至上的重重压力,成长为中国历史上唯一的女皇?
据史料记载,武则天父亲武士彟(yuē)因病早逝,她几乎是在母亲杨牡丹教导下成长为才人的。很多读者或许不知道,武则天母亲杨氏之墓——顺陵,就位于陕西西咸新区空港新城。
“按照习俗,嫁出去的女子大年初二要回娘家拜年。假如武则天在世,是不是初二这天要来看看她娘?”家住顺陵旁边的村民侯先生开玩笑地说。
大龄文艺女青年武则天母亲嫁得好生得好
“昨晚的剧情,媚娘的母亲荣国夫人去世了,你看到她妈长什么样子吗?”2月2日中午,袁先生和苏先生作为《武媚娘传奇》的铁杆粉丝,讨论起剧情来,“没看到啊,不过媚娘看起来挺难过的……”和众多观众一样,两人并没有在电视剧里欣赏到荣国夫人的容颜和她的为人处世。
据史料记载,武则天之母杨牡丹出身名门望族。在杨牡丹病重期间,武则天曾提出,将父母一起安葬在山西文水老家,但遭到母亲拒绝。咸亨元年(670年),杨牡丹生命垂危,武则天赶到洛阳也没见到母亲最后一面,十分伤心。
“武则天很敬重她的母亲,母亲去世后,随着她的权力不断巩固,她不断加封母亲并续建陵墓。”顺陵文管所所长岳文科介绍说,杨牡丹在不惑之年才在唐高祖的撮合下,下嫁给武士彟,成为两个已经成年孩子的后娘,武则天是杨牡丹和武士彟的二女儿。杨牡丹生前曾表示“愿葬于先茔之侧”,武则天便顺从了母亲。根据近代考古发现,如今的咸阳市渭城区底张街办北杜一带为杨氏家族墓地。
母亲对武则天的影响显然是不可低估的。据《从尼姑到女皇的政治博弈》一书所说,杨牡丹年幼时,不喜欢针织女活,却对诗书礼仪颇感兴趣,曾写下“当使恶无闻于九族,善有布于四方”。杨牡丹有了武则天后,专门请诗学、音律、礼仪方面的先生为她做家教。
武则天年幼与母相依为命 铸就了坚忍性格
研究唐史的西北大学李老师称,根据台湾教授雷家骥的《武则天传》等资料来看,由于家庭剧变、家庭矛盾以及父母的家庭地位等原因,自幼与母亲相依为命的武则天具有坚忍的一面。“我的一些学生也在看《武媚娘传奇》,大家会讨论演绎的历史和真实的历史有多大差距。”李老师说,“能够激发更多人了解这段历史并且探究历史进而学习唐文化,这就是积极的一面。”
据华商报记者了解,埋葬武则天母亲的唐顺陵,是西咸新区重要的历史文化遗存,陵前石刻是唐代雕刻艺术的集中体现,是与茂陵汉代石刻媲美的中国古代艺术精品。空港新城在配合当地文物部门做好陵园和石刻保护工作的同时,采取了生态园林方式保护唐顺陵。自2014年4月顺陵作为文化生态遗址园林向市民免费开放以来,接待了众多石刻、摄影爱好者以及休闲游玩的市民。
今天的顺陵不仅承载了故人的故事,更以新面貌承载着那段历史和文化。岳文科时常踏进顺陵,端详着这里的石刻石碑,他说:“顺陵走狮的雕刻写实程度和艺术夸张的精湛技艺,被誉为中华第一狮。希望大家能在这里感受到更丰富的历史。”
" alt="武则天之母出身名门文艺女青年?不惑之年下嫁">武则天之母出身名门文艺女青年?不惑之年下嫁