音乐播放器的实现

作者:网球

正文转自:

strings.xml

  我们在注册为某一个网址会员时,以前平常都要允许一些合同技艺注册成功,在表弟大应用里也是一模一样的,我们后生可畏致需求具名部分合计工夫开展下一步动作。
  下边这几个应用是当大家勾选“小编同意”后,文字内容会变,同有时间”明显“按键能够点击,否则”分明“按键是不可能点击,也正是说不能够张开下一步动作。

  顾客注册

view plaincopy to clipboardprint?

  实现步骤

1.第生机勃勃,先画你想要编写翻译出的分界面图片 1

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <resources>
    1. <string name="app_name">MusicPlayer</string>
  3. <string name="music_name">曲目</string>
  4. <string name="play_text">播放</string>
  5. <string name="pause_text">暂停</string>
  6. <string name="continue_text">继续</string>
  7. <string name="reset_text">重置</string>
  8. <string name="stop_text">停止</string>
  9. <string name="choose_text">选择</string>
  10. <string name="notfoundfile_text">媒体文件不设有</string>
  11. <string name="notfoundSdcard_text">SDcard不存在</string>
    1. </resources>

  风流浪漫:布局文件编写

遗闻草图,仅仅使用linearLayout的布局是非常不足的,还必要与RelativeLayout嵌套使用

<?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">MusicPlayer</string> <string name="music_name">曲目</string> <string name="play_text">播放</string> <string name="pause_text">暂停</string> <string name="continue_text">继续</string> <string name="reset_text">重置</string> <string name="stop_text">停止</string> <string name="choose_text">选择</string> <string name="notfoundfile_text">媒体文件空头支票</string> <string name="notfoundSdcard_text">SDcard不存在</string> </resources>

  1.1:布局文件main.xml

编写String.Xml

main.xml

  <?xml version="1.0" encoding="utf-8"?>
  <LinearLayout xmlns:android=""
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      >
  <TextView  
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:text="@string/content"
       android:id="@+id/tv"
     />
    <CheckBox 
         android:layout_width="wrap_content"  
         android:layout_height="wrap_content"
         android:text="我同意"
         android:id="@+id/checkbox"
    /> 
   <Button
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:text="确定"
     android:id="@+id/btn1"
    />
  </LinearLayout>

<?xml version="1.0" encoding="utf-8"?>

view plaincopy to clipboardprint?

  二:代码文件编写制定

<resources>

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android=""
  3. android:layout_width="fill_parent"
  4. android:layout_height="fill_parent"
  5. android:orientation="vertical" >
    1. <TextView
  6. android:layout_width="fill_parent"
  7. android:layout_height="wrap_content"
  8. android:text="@string/music_name" />
    1. <TableLayout
  9. android:layout_width="fill_parent"
  10. android:layout_height="wrap_content"
  11. android:stretchColumns="0" >
    1. <TableRow >
  12. <EditText
  13. android:id="@+id/musicEt"
  14. android:layout_width="fill_parent"
  15. android:layout_height="wrap_content"
  16. android:text="l.mp3" />
    1. <Button
  17. android:id="@+id/chooseBtn"
  18. android:layout_width="wrap_content"
  19. android:layout_height="wrap_content"
  20. android:text="@string/choose_text" />
    1. </TableRow>
  21. </TableLayout>
    1. <SeekBar
  22. android:id="@+id/seekBar"
  23. android:layout_width="fill_parent"
  24. android:layout_height="wrap_content" />
  25. <SeekBar
  26. android:id="@+id/seekBarSound"
  27. android:layout_width="fill_parent"
  28. android:layout_height="wrap_content"
  29. android:max="100"
  30. android:progress="10"/>
    1. />
    1. <TextView
  31. android:id="@+id/time"
  32. android:layout_width="fill_parent"
  33. android:layout_height="wrap_content"
  34. />
    1. <TableLayout
  35. android:layout_width="fill_parent"
  36. android:layout_height="wrap_content"
  37. android:stretchColumns="*" >
    1. <TableRow >
    1. <Button
  38. android:id="@+id/playBtn"
  39. android:layout_width="wrap_content"
  40. android:layout_height="wrap_content"
  41. android:text="@string/play_text" />
    1. <Button
  42. android:id="@+id/pauseBtn"
  43. android:layout_width="wrap_content"
  44. android:layout_height="wrap_content"
  45. android:text="@string/pause_text" />
    1. <Button
  46. android:id="@+id/stopBtn"
  47. android:layout_width="wrap_content"
  48. android:layout_height="wrap_content"
  49. android:text="@string/stop_text" />
  50. </TableRow>
  51. </TableLayout>
    1. </LinearLayout>

  2. 1:MainActivity.java

 

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/music_name" /> <TableLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:stretchColumns="0" > <TableRow > <EditText android:id="@+id/musicEt" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="l.mp3" /> <Button android:id="@+id/chooseBtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/choose_text" /> </TableRow> </TableLayout> <SeekBar android:id="@+id/seekBar" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <SeekBar android:id="@+id/seekBarSound" android:layout_width="fill_parent" android:layout_height="wrap_content" android:max="100" android:progress="10"/> /> <TextView android:id="@+id/time" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <TableLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:stretchColumns="*" > <TableRow > <Button android:id="@+id/playBtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/play_text" /> <Button android:id="@+id/pauseBtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/pause_text" /> <Button android:id="@+id/stopBtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/stop_text" /> </TableRow> </TableLayout> </LinearLayout>

  package com.menglin.checkbox;

    <string name="hello">Hello World, UserLoginActivity!</string>

MusicPlayerActivity.java

  import android.app.Activity;
  import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.CheckBox;
  import android.widget.TextView;

    <string name="app_name">客户注册分界面</string>

view plaincopy to clipboardprint?

  public class MianActivity extends Activity
  {
     //声澳优(Ausnutria Hyproca)个Button对象
     private Button mybtn = null;

    <string name="nameString">用户名</string>

  1. package cn.csdn.playle;
    1. import java.io.File;
  2. import java.io.IOException;
    1. import android.app.Activity;
  3. import android.content.Context;
  4. import android.content.Intent;
  5. import android.media.AudioManager;
  6. import android.media.MediaPlayer;
  7. import android.os.Bundle;
  8. import android.os.Environment;
  9. import android.os.Handler;
  10. import android.util.Log;
  11. import android.view.View;
  12. import android.view.View.OnClickListener;
  13. import android.widget.Button;
  14. import android.widget.EditText;
  15. import android.widget.SeekBar;
  16. import android.widget.SeekBar.OnSeekBarChangeListener;
  17. import android.widget.TextView;
  18. import android.widget.Toast;
    1. public class MusicPlayerActivity extends Activity implements OnClickListener,
  19. OnSeekBarChangeListener {
    1. EditText musicEt;
  20. Button playBtn, pauseBtn, stopBtn, chooseBtn;
  21. TextView time;
  22. AudioManager audiomanage;
  23. int maxVolume, currentVolume;
  24. SeekBar seekBar, seekBarSound;
  25. MediaPlayer player = null;
    1. File file = null;
    1. int position = 0;
  26. int i = 0;
  27. Handler handler = new Handler();
      1. public void onCreate(Bundle savedInstanceState) {
  28. super.onCreate(savedInstanceState);
  29. setContentView(R.layout.main);
    1. player = new MediaPlayer();
    1. findViews();
  30. }
    1. private void findViews() {
  31. musicEt = (EditText) this.findViewById(R.id.musicEt);
  32. playBtn = (Button) this.findViewById(R.id.playBtn);
  33. pauseBtn = (Button) this.findViewById(R.id.pauseBtn);
  34. stopBtn = (Button) this.findViewById(R.id.stopBtn);
  35. chooseBtn = (Button) this.findViewById(R.id.chooseBtn);
  36. seekBar = (SeekBar) this.findViewById(R.id.seekBar);
  37. seekBarSound = (SeekBar) this.findViewById(R.id.seekBarSound);
  38. time = (TextView) this.findViewById(R.id.time);
      1. time.setOnClickListener(this);
  39. playBtn.setOnClickListener(this);
  40. pauseBtn.setOnClickListener(this);
  41. stopBtn.setOnClickListener(this);
  42. stopBtn.setEnabled(false);
  43. pauseBtn.setEnabled(false);
    1. seekBar.setOnSeekBarChangeListener(this);
    1. chooseBtn.setOnClickListener(new OnClickListener() {
    1. public void onClick(View v) {
    1. Intent intent = new Intent(MusicPlayerActivity.this,
  44. MusicListActivity.class);
  45. startActivity(intent);
  46. }
  47. });
    1. audiomanage = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
  48. maxVolume = audiomanage.getStreamMaxVolume(AudioManager.STREAM_MUSIC); // 获取系统最大音量
  49. seekBarSound.set马克斯(maxVolume); // 拖动条最高值与系统最大声相配
  50. currentVolume = audiomanage.getStreamVolume(AudioManager.STREAM_MUSIC); // 获取当前值
  51. seekBarSound.setProgress(currentVolume);
    1. seekBarSound.setOnSeekBarChangeListener(new OnSeekBarChangeListener() // 调音监听器
  52. {
  53. public void onProgressChanged(SeekBar arg0, int progress,
  54. boolean fromUser) {
  55. audiomanage.setStreamVolume(AudioManager.STREAM_MUSIC,
  56. progress, 0);
  57. currentVolume = audiomanage
  58. .getStreamVolume(AudioManager.STREAM_MUSIC); // 获取当前值
  59. seekBarSound.setProgress(currentVolume);
    1. }
    1. public void onStartTrackingTouch(SeekBar seekBar) {
    1. }
    1. public void onStopTrackingTouch(SeekBar seekBar) {
    1. }
  60. });
    1. Intent intent = this.getIntent();
  61. String name = intent.getStringExtra("name");
  62. musicEt.setText(name);
  63. }
    1. public void onClick(View v) {
    1. String fileName = musicEt.getText().toString().trim();
    1. // 获取sdcard的状态是或不是已加载 (MEDIA_MOUNTED 加载状态)
  64. if (Environment.getExternalStorageState().equals(
  65. Environment.MEDIA_MOUNTED)) {
  66. file = new File(Environment.getExternalStorageDirectory(), fileName);
    1. // 剖断所播放的媒体文件是或不是留存
  67. if (file.exists()) {
    1. try {
  68. switch (v.getId()) {// 再次回到八个int值
    1. case R.id.playBtn:
  69. playMusic(file);
    1. break;
    1. case R.id.pauseBtn:
  70. if (player.isPlaying()) {
  71. player.pause();
  72. pauseBtn.setText(R.string.continue_text);
  73. } else {
  74. player.start();
  75. pauseBtn.setText(R.string.pause_text);
  76. }
  77. break;
    1. case R.id.stopBtn:
  78. player.stop();
  79. stopBtn.setEnabled(false);
  80. seekBar.setProgress(0);
  81. if (playBtn.getText().toString().equals("重置")) {
  82. playBtn.setText(R.string.play_音乐播放器的实现。text);
  83. }
  84. if (pauseBtn.getText().toString().equals("继续")) {
  85. pauseBtn.setText(R.string.pause_text);
  86. pauseBtn.setEnabled(false);
  87. } else {
  88. pauseBtn.setEnabled(false);
  89. }
    1. break;
    1. }
  90. } catch (IllegalArgumentException e) {
  91. Log.e("TAG", e.toString());
  92. } catch (IllegalStateException e) {
  93. Log.e("TAG", e.toString());
  94. } catch (IOException e) {
  95. Log.e("TAG", e.toString());
  96. }
  97. } else {
  98. Toast.makeText(this, R.string.notfoundfile_text,
  99. Toast.LENGTH_LONG).show();
  100. }
  101. }
    1. else {
  102. Toast.makeText(this, R.string.notfoundSdcard_text,
  103. Toast.LENGTH_LONG).show();
  104. }
  105. }
    1. protected void onDestroy() {
  106. if (player != null) {
  107. if (player.isPlaying()) {
  108. player.stop();
  109. }
  110. player.release();
  111. }
  112. super.onDestroy();
  113. }
    1. protected void onPause() {
  114. if (player != null) {
  115. if (player.isPlaying()) {
  116. player.pause();
  117. }
  118. }
  119. super.onPause();
  120. }
    1. private void playMusic(File file) throws IllegalStateException, IOException {
    1. if (musicEt.getText().toString() == null
  121. || "".equals(musicEt.getText().toString())) {
  122. Toast.makeText(this, "没有入选歌曲", Toast.LENGTH_LONG).show();
  123. } else {
  124. if (player != null) {
  125. pauseBtn.setEnabled(true);
    1. player.reset();
  126. player.setDataSource(file.getAbsolutePath());
  127. player.prepare();
  128. player.start();
  129. playBtn.setText(R.string.reset_text);
  130. run();
  131. }
  132. if (playBtn.getText().toString().equals("重置")) {
  133. pauseBtn.setEnabled(true);
  134. stopBtn.setEnabled(true);
    1. }
  135. if (pauseBtn.getText().toString().equals("继续")) {
  136. pauseBtn.setText(R.string.pause_text);
  137. }
    1. }
  138. }
    1. private void run() {
  139. new Thread(new Runnable() {
  140. public void run() {
  141. while (player != null) {
  142. int TIME = player.getDuration();
  143. seekBar.set马克斯(TIME);// 获取歌曲的最大值
  144. position = player.getCurrentPosition();// 重临当前播放进程值
  145. seekBar.setProgress(position);
    1. try {
  146. Thread.sleep(3000);
  147. } catch (InterruptedException e) {
  148. e.printStackTrace();
  149. }
    1. }
  150. }
    1. }).start();
  151. }
    1. public void onProgressChanged(SeekBar seekBar, int progress,
  152. boolean fromUser) {
    1. }
    1. public void onStartTrackingTouch(SeekBar seekBar) {
    1. player.seekTo(seekBar.getProgress());
    1. }
    1. public void onStopTrackingTouch(SeekBar seekBar) {
    1. player.seekTo(seekBar.getProgress());
  153. }
    1. }

     //声诺优能个TextView 对象
     private TextView mytv = null;

    <string name="ageString">年龄</string>

package cn.csdn.playle; import java.io.File; import java.io.IOException; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.media.AudioManager; import android.media.MediaPlayer; import android.os.Bundle; import android.os.Environment; import android.os.Handler; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.TextView; import android.widget.Toast; public class MusicPlayerActivity extends Activity implements OnClickListener, OnSeekBarChangeListener { EditText musicEt; Button playBtn, pauseBtn, stopBtn, chooseBtn; TextView time; AudioManager audiomanage; int maxVolume, currentVolume; SeekBar seekBar, seekBarSound; MediaPlayer player = null; File file = null; int position = 0; int i = 0; Handler handler = new Handler(); public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); player = new MediaPlayer(); findViews(); } private void findViews() { musicEt = (EditText) this.findViewById(R.id.musicEt); playBtn = (Button) this.findViewById(R.id.playBtn); pauseBtn = (Button) this.findViewById(R.id.pauseBtn); stopBtn = (Button) this.findViewById(R.id.stopBtn); chooseBtn = (Button) this.findViewById(R.id.chooseBtn); seekBar = (SeekBar) this.findViewById(R.id.seekBar); seekBarSound = (SeekBar) this.findViewById(R.id.seekBarSound); time = (TextView) this.findViewById(R.id.time); time.setOnClickListener(this); playBtn.setOnClickListener(this); pauseBtn.setOnClickListener(this); stopBtn.setOnClickListener(this); stopBtn.setEnabled(false); pauseBtn.setEnabled(false); seekBar.setOnSeekBarChangeListener(this); chooseBtn.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent intent = new Intent(MusicPlayerActivity.this, MusicListActivity.class); startActivity(intent); } }); audiomanage = (AudioManager) getSystemService(Context.AUDIO_SERVICE); maxVolume = audiomanage.getStreamMaxVolume(AudioManager.STREAM_MUSIC); // 获取系统最大音量 seekBarSound.set马克斯(maxVolume); // 拖动条最高值与系统最大声相称 currentVolume = audiomanage.getStreamVolume(奥迪oManager.STREAM_MUSIC); // 获取当前值 seekBarSound.setProgress(currentVolume); seekBarSound.setOnSeekBarChangeListener(new OnSeekBarChangeListener() // 调音监听器 { public void onProgressChanged(SeekBar arg0, int progress, boolean fromUser) { audiomanage.setStreamVolume(奥迪oManager.STREAM_MUSIC, progress, 0); currentVolume = audiomanage .getStreamVolume(AudioManager.STREAM_MUSIC); // 获取当前值 seekBarSound.setProgress(currentVolume); } public void onStartTrackingTouch(SeekBar seekBar) { } public void onStopTrackingTouch(SeekBar seekBar) { } }); Intent intent = this.getIntent(); String name = intent.getStringExtra("name"); musicEt.setText(name); } public void onClick(View v) { String fileName = musicEt.getText().toString().trim(); // 获取sdcard的事态是或不是已加载 (MEDIA_MOUNTED 加载状态) if (Environment.getExternalStorageState().equals( Environment.MEDIA_MOUNTED)) { file = new File(Environment.getExternalStorageDirectory(), fileName); // 剖断所播放的媒体文件是还是不是存在 if (file.exists()) { try { switch (v.getId()) {// 重临叁个int值 case 揽胜.id.playBtn: playMusic(file); break; case 大切诺基.id.pauseBtn: if (player.isPlaying()) { player.pause(); pauseBtn.setText(ENVISION.string.continue_text); } else { player.start(); pauseBtn.setText(R.string.pause_text); } break; case R.id.stopBtn: player.stop(); stopBtn.setEnabled(false); seekBar.setProgress(0); if (playBtn.getText().toString().equals("重置")) { playBtn.setText(R.string.play_text); } if (pauseBtn.getText().toString().equals("继续")) { pauseBtn.setText(R.string.pause_text); pauseBtn.setEnabled(false); } else { pauseBtn.setEnabled(false); } break; } } catch (IllegalArgumentException e) { Log.e("TAG", e.toString()); } catch (IllegalStateException e) { Log.e("TAG", e.toString()); } catch (IOException e) { Log.e("TAG", e.toString()); } } else { Toast.makeText(this, R.string.notfoundfile_text, Toast.LENGTH_LONG).show(); } } else { Toast.makeText(this, R.string.notfoundSdcard_text, Toast.LENGTH_LONG).show(); } } protected void onDestroy() { if (player != null) { if (player.isPlaying()) { player.stop(); } player.release(); } super.onDestroy(); } protected void onPause() { if (player != null) { if (player.isPlaying()) { player.pause(); } } super.onPause(); } private void playMusic(File file) throws IllegalStateException, IOException { if (musicEt.getText().toString() == null || "".equals(musicEt.getText().toString())) { Toast.makeText(this, "未有当选歌曲", Toast.LENGTH_LONG).show(); } else { if (player != null) { pauseBtn.setEnabled(true); player.reset(); player.setDataSource(file.getAbsolutePath()); player.prepare(); player.start(); playBtn.setText(R.string.reset_text); run(); } if (playBtn.getText().toString().equals("重置")) { pauseBtn.setEnabled(true); stopBtn.setEnabled(true); } if (pauseBtn.getText().toString().equals("继续")) { pauseBtn.setText(R.string.pause_text); } } } private void run() { new Thread(new Runnable() { public void run() { while (player != null) { int TIME = player.getDuration(); seekBar.set马克斯(TIME);// 获取歌曲的最大值 position = player.getCurrentPosition();// 重临当前播报进程值 seekBar.setProgress(position); try { Thread.sleep(3000); } catch (InterruptedException e) { e.printStackTrace(); } } } }).start(); } public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { } public void onStartTrackingTouch(SeekBar seekBar) { player.seekTo(seekBar.getProgress()); } public void onStopTrackingTouch(SeekBar seekBar) { player.seekTo(seekBar.getProgress()); } }

     //声美赞臣个CheckBox 对象
     private CheckBox mycheckBox = null;
     @Override
     public void onCreate(Bundle savedInstanceState)
     {
        super.onCreate(savedInstanceState);
        //加载main.xml布局文件
        setContentView(R.layout.main);
        //以findViewById()方法取得Button对象
        mybtn = (Button)findViewById(R.id.btn1);
        //以findViewById()方法获得TextView对象
        mytv = (TextView)findViewById(R.id.tv);
        //以findViewById()方法获得CheckBox对象
        mycheckBox = (CheckBox)findViewById(R.id.checkbox);
        //给CheckBox对象绑定单击监听事件
        mycheckBox.setOnClickListener(listener);
        //将CheckBox默许设置为未选取景况
        mycheckBox.setChecked(false);
        //将Button暗许设置为未启用意况
        mybtn.setEnabled(false);
    }
 
   //监听事件
   private OnClickListener listener = new OnClickListener()
   { 
      @Override
      public void onClick(View v)
      {
         //若是CheckBox选中的话
         if(mycheckBox.isChecked())
         {
            //将Button设置为启用景况
            mybtn.setEnabled(true);
            //设置TextView显示的原委
            mytv.setText("您已总体阅读该左券况且同意");
         }
         else 
         {
            //将Button暗中认可设置为未启用情形
            mybtn.setEnabled(false);
            //设置TextView呈现的内容
            mytv.setText(R.string.content);
         }
      }
   };
 }

    <string name="registerButtonText">注册</string>

效果图:

 三:常量文件

    <string name="sexString">性别</string>

图片 2

  string.xml

  <string name="favoriteString">喜好</string>

  <?xml version="1.0" encoding="utf-8"?>
  <resources>
    <string name="content">这里是安卓开荒结盟左券,要是你同意此左券请点击...</string>
    <string name="app_name">CheckBoxDemo</string>
  </resources>

  <string name="cityString">城市</string>

  运维作效果果如下 

  <string name="passString">密码</string>

  图片 3

  <string name="pingpang">兵乓球</string>

 

  <string name="basketball">篮球</string>

  图片 4

  <string name="football">足球</string>

 

  <string name="tennis">网球</string>

  

</resources>

 

 

 

编写parameters.xml:

那是贮存属性音信,如字体、TextView和EditText的上涨的幅度。

<?xml version="1.0" encoding="utf-8"?>

<resources>

    <dimen name="fontSize">22px</dimen>

    <dimen name="TextViewWidth">90px</dimen>

    <dimen name="EditTextWidth">160px</dimen>

</resources>

 

再编写main.xml

 

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android=""

    android:layout_width="fill_parent"

    android:layout_height="fill_parent"

    android:orientation="vertical" >

<RelativeLayout

    android:layout_width="fill_parent"

    android:layout_height="wrap_content"

    >

    <TextView

        android:layout_width="@dimen/TextViewWidth"

        android:layout_height="wrap_content"

        android:text="@string/nameString"

        android:textSize="@dimen/fontSize"

        android:id="@+id/name"/>

    <EditText

        android:layout_width="@dimen/EditTextWidth"

        android:layout_height="wrap_content"

        android:layout_toRightOf="@string/nameString"

        android:layout_alignTop="@id/name"

        android:id="@+id/nameValue"/>/

   

</RelativeLayout>

<RelativeLayout

    android:layout_width="fill_parent"

    android:layout_height="wrap_content"

    >

    <TextView

        android:layout_width="@dimen/EditTextWidth"

        android:layout_height="wrap_content"

        android:text="@string/passString"

        android:textSize="@dimen/fontSize"

        android:id="@+id/pass"/>

    <EditText

        android:password="true"

        android:layout_width="@dimen/EditTextWidth"

        android:layout_height="wrap_content"

        android:layout_toRightOf="@id/pass"

        android:layout_alignTop="@id/pass"

        android:id="@+id/passValue"

        />

    </RelativeLayout>

    <RelativeLayout

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

        >

        <TextView android:layout_width="@dimen/TextViewWidth"

            android:layout_height="wrap_content"

            android:text="@string/ageString"

            android:textSize="@dimen/fontSize"

            android:id="@+id/age"

            />

           

    <EditText

     

        android:layout_width="@dimen/EditTextWidth"

        android:layout_height="wrap_content"

        android:layout_toRightOf="@id/age"

        android:layout_alignTop="@id/age"

        android:id="@+id/ageValue"

        />

       

    </RelativeLayout>

    <RelativeLayout

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

        >

        <TextView android:layout_width="@dimen/TextViewWidth"

            android:layout_height="wrap_content"

            android:text="@string/sexString"

            android:textSize="@dimen/fontSize"

            android:id="@+id/sex"

            />

           

    <RadioGroup

      

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_toRightOf="@id/sex"

        android:checkedButton="@+id/radioMan"

        android:orientation="horizontal"

        android:id="@+id/sexMenu">

      <RadioButton android:text="男" android:id="@id/radioMan"/>

      <RadioButton android:text="女" android:id="@+id/radioWomen"/>

本文由威尼斯城真人赌钱网站发布,转载请注明来源

关键词: