当前位置: 首页 > news >正文

赣州做网站的公司哪家好免费开发软件制作平台

赣州做网站的公司哪家好,免费开发软件制作平台,wordpress怎么搬迁,网站程序风格RadioGroup类用于单选按钮集。 如果我们选中属于某个单选按钮组的一个单选按钮,它将自动取消选中同一组中以前选中的任何单选按钮。 RadioGroup属性 以下是与RadioGroup控制相关的重要属性。您可以查看Android官方文档以获取属性的完整列表以及可以在运行时更改这些属性的相关…

RadioGroup类用于单选按钮集。

如果我们选中属于某个单选按钮组的一个单选按钮,它将自动取消选中同一组中以前选中的任何单选按钮。

RadioGroup属性

以下是与RadioGroup控制相关的重要属性。您可以查看Android官方文档以获取属性的完整列表以及可以在运行时更改这些属性的相关方法。

属性说明
android:checkedButton这是默认情况下应在此单选组中选中的子单选按钮的ID。

继承自 android.view.View 类-

Sr.No.Attribute & 描述
1

android:background

这是一个可绘制的背景。

2

android:content描述

这定义了简短描述视图内容的文本。

3

android:id

这提供了该视图的标识符名称

4

android:onClick

这是单击该视图时在该视图中要调用的方法的名称。

5

android:visibility

这控制了视图的初始可见性。

示例

本示例将带您通过简单的步骤,展示如何使用Linear Layout和RadioGroup创建自己的Android应用程序。

以下是修改后的主要Activity文件 src/MainActivity.java 的内容。该文件可以包括每个基本生命周期方法。

package com.example.saira_000.myapplication;import android.app.Activity;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Toast;public class MainActivity extends Activity {private RadioGroup radioSexGroup;private RadioButton radioSexButton;private Button btnDisplay;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);radioSexGroup=(RadioGroup)findViewById(R.id.radioGroup);btnDisplay=(Button)findViewById(R.id.button);btnDisplay.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {int selectedId=radioSexGroup.getCheckedRadioButtonId();radioSexButton=(RadioButton)findViewById(selectedId);Toast.makeText(MainActivity.this,radioSexButton.getText(),Toast.LENGTH_SHORT).show();}});}
}

以下是 res/layout/activity_main.xml 文件的内容-

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"android:paddingRight="@dimen/activity_horizontal_margin"android:paddingTop="@dimen/activity_vertical_margin"android:paddingBottom="@dimen/activity_vertical_margin"tools:context=".MainActivity"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Radio button"android:id="@+id/textView"android:layout_alignParentTop="true"android:layout_centerHorizontal="true"android:textSize="35dp" /><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Learnfk"android:id="@+id/textView2"android:layout_below="@+id/textView"android:layout_alignRight="@+id/textView"android:layout_alignEnd="@+id/textView"android:textSize="35dp"android:textColor="@android:color/holo_green_dark" /><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:id="@+id/imageView"android:src="@drawable/abc"android:layout_below="@+id/textView2"android:layout_alignLeft="@+id/textView"android:layout_alignStart="@+id/textView"android:layout_alignRight="@+id/textView"android:layout_alignEnd="@+id/textView" /><RadioGroupandroid:layout_width="fill_parent"android:layout_height="90dp"android:layout_below="@+id/imageView"android:layout_marginTop="58dp"android:weightSum="1"android:id="@+id/radioGroup"android:layout_alignLeft="@+id/textView2"android:layout_alignStart="@+id/textView2"android:layout_alignRight="@+id/textView3"android:layout_alignEnd="@+id/textView3"><RadioButtonandroid:layout_width="wrap_content"android:layout_height="55dp"android:text="Male"android:id="@+id/radioButton"android:layout_gravity="center_horizontal"android:checked="false"android:textSize="25dp" /><RadioButtonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Female"android:id="@+id/radioButton2"android:layout_gravity="center_horizontal"android:checked="false"android:textSize="25dp"android:layout_weight="0.13" /></RadioGroup><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="    Are you?"android:id="@+id/textView3"android:textSize="35dp"android:layout_below="@+id/imageView"android:layout_alignRight="@+id/textView2"android:layout_alignEnd="@+id/textView2"android:layout_alignLeft="@+id/imageView"android:layout_alignStart="@+id/imageView" /><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="New Button"android:id="@+id/button"android:layout_gravity="center_horizontal"android:layout_below="@+id/radioGroup"android:layout_centerHorizontal="true" /></RelativeLayout>

以下是 res/values/strings.xml 的内容,以定义这些新常量-

<?xml version="1.0" encoding="utf-8"?>
<resources><string name="app_name">My Applicaiton</string><string name="example_radiogroup">Example showing RadioGroup</string>
</resources>

以下是 AndroidManifest.xml 的默认内容-

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="com.example.saira_000.myapplication" ><applicationandroid:allowBackup="true"android:icon="@drawable/ic_launcher"android:label="@string/app_name"android:theme="@style/AppTheme" ><activityandroid:name="com.example.My Application.MainActivity"android:label="@string/app_name" ><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity></application>
</manifest>

Android 中的 RadioGroup函数 - 无涯教程网无涯教程网提供RadioGroup类用于单选按钮集。如果我们选中属于某个单选按钮组的一个单选按钮,它将自...https://www.learnfk.com/android/android-radiogroup-control.html

http://www.shuangfujiaoyu.com/news/27730.html

相关文章:

  • 平面设计师常用的网站建什么网站可以长期盈利
  • 西安网站制作计划沈阳关键词优化费用
  • 网站怎么谈设计百度热搜广告位
  • 一个网站的建设需要什么手续seo课程心得体会
  • 做网站公司无锡百度搜索引擎优化的养成良好心态
  • wordpress修改分类标题江阴网站优化公司
  • 山东政府网站集约化建设今日头条新闻下载安装
  • 网站规划建设与管理维护cnzz站长统计工具
  • 购物网站源码软文素材网
  • wordpress集团网站百度地图导航2021最新版
  • 自己搭建环境建设网站百度词条搜索排行
  • 在线制作网站淘宝代运营公司十大排名
  • 书画网站建设方案策划国内企业网站模板
  • 越秀营销型网站2021关键词搜索排行
  • 注册城乡规划师挂靠关键词排名优化软件策略
  • 做家政公司网站设计网站模板
  • 专业网站建设公司地址营销型网站制作成都
  • 建设网银登录网站百度关键词竞价排名
  • app网站排名市场调研怎么做
  • 建设企业网站价钱深圳推广优化公司
  • 做农宿的网站如何自己开发软件app
  • 西安建设网站的公司简介seo有哪些经典的案例
  • 网站开发工资淄博信息流优化师
  • 用java做信息发布网站好看的网站模板
  • 商店网站在线设计seo快速建站
  • 甘肃网站建设方案服务至上黄冈地区免费网站推广平台
  • 北京企业网站建设飞沐阿里云官网首页
  • 网站建设徐州百度网络网站网站优化公司开始上班了
  • 网站为什么做版心限制seo优化报价公司
  • 网站开发商标属于哪一类图们网络推广