RadioGroup

Delphi类引用示例

…衆ロ難τιáo~ 提交于 2020-04-26 14:10:38
相关资料: https://jingyan.baidu.com/article/bad08e1e2ec23b09c9512148.html 实例代码: 1 unit Unit1; 2 3 interface 4 5 uses 6 Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls; 8 9 type 10 TControlClass = class of TControl; 11 12 TForm1 = class (TForm) 13 RadioGroup1: TRadioGroup; 14 procedure FormCreate(Sender: TObject); 15 procedure RadioGroup1Click(Sender: TObject); 16 procedure FormMouseDown(Sender: TObject; Button: TMouseButton; 17 Shift: TShiftState; X, Y: Integer); 18 private 19 {

2018-2019-20175205实验四《Android程序设计》实验报告

大憨熊 提交于 2020-04-24 18:07:30
#2018-2019-20175205实验四《Android程序设计》实验报告 [TOC] 实验要求 参考 Android开发简易教程 完成云班课中的检查点,也可以先完成实验报告,直接提交。注意不能只有截图,要有知识点,原理,遇到的问题和解决过程等说明。实验报告中一个检查点要有多张截图。 发表实验报告博客,标题“学期(如2018-2019-2) 学号(如20175300) 实验四《Android开发基础》实验报告” 教材学习 ###第二十五章 活动 Android中的四大组件 Activity Service ContentProvider Broadcast Receiver 其中Activity是Android系统中最常用、最常见的一个组件,一个应用通常包含了多个Activity Activity类定义了如下的回调事件 -onCreate():这是第一个回调方法。当Activity首次被创建时会调用它 onStart:当Activity对于用户来说变为可视状态时会回调此方法 onResume():当用户开始与应用交互时会调用此方法 onPause():当前的Activity正在暂停中,并且先前的Activity正在恢复时,被暂停的这个Activity不会再接收用户的输入,也不再执行任何代码和调用 onStop():当Activity不再为可视状态时会调用该回调方法

更改antd radio样式 竖排显示

淺唱寂寞╮ 提交于 2020-04-14 16:24:57
【推荐阅读】微服务还能火多久?>>> antd 的Radio单选框 默认是左侧显示按钮右侧显示文字,新的需求是按钮在上方,文字在按钮下方显示. api上也没有找到修改样式的方法,就自己替换了样式, const radioStyle = { display:'flex' , flexFlow:'column' , alignItems:'center' , } 在父元素 RadioGroup上设置style display:'flex',子元素用自定义的样式替换就好了 <RadioGroup style={{display:'flex'}}> <Radio style={radioStyle} value={1}> Option A </Radio> </RadioGroup> 来源: oschina 链接: https://my.oschina.net/u/4259099/blog/3234605

安卓开发学习------6.练习SharedPreferences用法和文件IO

六眼飞鱼酱① 提交于 2020-04-14 14:21:37
【推荐阅读】微服务还能火多久?>>> SharedPreferences是安卓里的一种存储方式,利用键值对来存储,比较小巧。 更多的使用的还是文件的IO方式来进行存储数据。 代码如下,submit按键测试SharedPreferences功能,存储的是程序启动的次数,write按键是写入文本文件,read按键是将文本内容写入标题栏。 xml代码: < ? xml version = "1.0" encoding = "utf-8" ? > < androidx . constraintlayout . widget . ConstraintLayout xmlns : android = "http://schemas.android.com/apk/res/android" xmlns : app = "http://schemas.android.com/apk/res-auto" xmlns : tools = "http://schemas.android.com/tools" android : layout_width = "match_parent" android : layout_height = "match_parent" tools : context = ".ListActivity22" > < TextView android : id = "@+id

el-form-renderer 1.12.1 发布:支持设置动态 options

Deadly 提交于 2019-12-18 12:17:48
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 前言 还在 mounted 里调用接口后再用 setOptions 来更新表单的 options 数组吗🤕?现在不需要这样了! 使用 remote 属性,简单配置一下远端接口 url,即可自动发起请求并更新 options 属性🤛🏻! 甚至,任何 props 都可以通过 remote 来远程获取😃,快来看看吧! 场景 你正在愉快地使用 el-form-renderer 来维护表单。 <template> <el-form-renderer :content="content" /> </template> <script> export default { data() { return { content: [ { id: 'name', type: 'input', label: '姓名', rules: [{required: true, message: '请输入姓名'}] } ] } } } </script> 所有表单相关的配置都写在一处,体验太棒了。 此时,产品经理又提了个需求,你给表单加了一项 select。 <template> <el-form-renderer :content="content" /> </template> <script> export default { data(

RadioGroup动态添加RadioButton,并且获得事件

时光怂恿深爱的人放手 提交于 2019-12-09 20:08:07
由于有许多的RadioButton是动态的,不是固定的一些,所以需要在代码中,动态的添加到RadioGroup中,下面是我的实现方法。 1、添加RadioButton到RadioGroup中 [java] view plain copy RadioGroup group; for ( int i= 0 ; i< 10 ; i++) { RadioButton tempButton = new RadioButton( this ); tempButton.setBackgroundResource(R.drawable.xxx); // 设置RadioButton的背景图片 tempButton.setButtonDrawable(R.drawable.xxx); // 设置按钮的样式 tempButton.setPadding( 80 , 0 , 0 , 0 ); // 设置文字距离按钮四周的距离 tempButton.setText( "按钮 " + i); group.addView(tempButton, LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); } 2、为RadioGroup添加事件处理,可以得到当前选择的RadioButton [java] view

RadioGroup 自动换行且保留点击事件

倾然丶 夕夏残阳落幕 提交于 2019-12-09 19:53:11
相信用过RadioGroup的同学都踩过很多坑,其中之一就是这个控件设计的不是很合理,不能设置里面的radiobutton的 排列方式(几行几列),导致我们开发的时候要调整里面的布局很是麻烦。 另外一个坑是 动态new 的时候选默认值的问题,这个在之前的一篇文章 RadioGroup中RadioButton默认选中问题 这个里面已经提到过了,就不再细说了。今天主要说说这个radiogroup怎么调整布局为自动换行的问题。 当我们自己写完RadioGroup 后,里面写好radiobutton,非常简单,一通复制粘贴,一大排就出来了,运行一下 ,非常棒,单选等功能都很好用。就像这样 对应的界面展示效果: 默认选中了第一个,然后 ,产品经理过来了,你这么放肯定是不行的,能不能改成4行3列的。 然后你心想,小儿科,去查了一下RadioGroup的属性,发现并没有原生支持的属性,可以设置内部RadioButton的几行几列的属性。 继续想一下 ,这还能难道我? 然后写了几个LinearLayout 把RadioButton套起来。 于是代码被你改成了这样 对应的界面展示效果 完美实现 6不6 ,嘴角浮起了轻蔑的微笑... 然后运行,点击选一下试试,woc,不对啊,这点击效果不对啊 ,发现原来默认选中的 没有取消选中啊,点击事件不对了啊,分分钟懵逼了... 所以其实原生的RadioGroup

【Android】OnCheckedChangeListener is called twice

本秂侑毒 提交于 2019-12-09 19:50:49
RadioGroup.OnCheckedChangeListener is called twice 今天又碰到了,貌似还没有被修复,顺便贴出来。 原android Issue地址: RadioGroup.OnCheckedChangeListener is called twice when the selection is cleared 具体表现 RadioGroup中包含有若干个RadioButton,当在代码中调用RadioGroup.check(id)方法动态设置被选中的RadioButton的时候,RadioGroup.OnCheckedChangeListener(RadioGroup group, int checkedId)会被调用多次。 示例 假设当前选择的是RadioButtonA,调用RadioGroup.check(RadioButtonBid)之后,RadioGroup.OnCheckedChangeListener(RadioGroup group, int checkedId)的调用情况如下: 第一次:checkedId为RadioButtonAId 第二次:checkedId为RadioButtonBId 第三次:checkedId为RadioButtonBId 测试代码 public class MainActivity extends

Android 第十课——UI RadioButton

不想你离开。 提交于 2019-12-09 09:57:55
常用基础空组件 5 RadioGroup RadioButton 单选按钮时常用组件之一,但是开发过程中虽然很多地方会用到单选按钮,但是却不会用Android系统提供的原始样式,类似我们在写html时,不同的浏览器提供的单选按钮是不一样的,兼容性也很差,一般用图片替代伪装。但是无论如何伪装样式,单选按钮的功能都是一样的。下面就用一个 加减乘除 运算器来讲解单选按钮的功能,至于样式以后提供。 layout中组件: <RadioGroup android:id="@+id/operation" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <RadioButton android:id="@+id/addition" android:layout_width="wrap_content" android:layout_height="wrap_content" android:checked="true" android:text="@string/addition"/> <RadioButton android:id="@+id/subtraction" android:layout_width="wrap

单选按钮(RadioButton)——Mars Android开发视频教程之第一季第十集(重)

故事扮演 提交于 2019-12-07 13:45:15
##1· 什么是单选按钮(RadioButton)? 这样的按钮就叫单选按钮,这里有两组单选按钮; 一组单选按钮中,只能有一个选项被选中; ##2· RadioGroup与RadioButton RadioGroup代表组;RadioButton代表单选按钮项; ##3· 单选按钮的使用 <RadioGroup>包围<RadioButton>,一对<RadioGroup/>代表一组单选按钮。 首先在布局文件中添加一对组标签: <RadioGroup android:id="@+id/radioGroup1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"><!-- 选项的排列方向 --> </RadioGroup> 然后在组标签中添加子标签: <RadioGroup android:id="@+id/radioGroup1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <RadioButton android:id="@+id/radioButton_A