自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(20)
  • 资源 (1)
  • 问答 (1)
  • 收藏
  • 关注

原创 Android Studio App LinearLayout多层布局嵌套

LinearLayout内部嵌套LinearLayoutactivity_main.xml内容如下:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_wid

2015-08-30 20:56:15 9637 1

原创 Android Studio App 播放工程内部音乐文件

app播放app工程自带(不是SD卡里的)的音乐文件。1.在工程res文件夹里新建raw文件夹,在raw文件夹里放置一份mp3文件。2.在MainActivity.java文件里public class MainActivity extends Activity下面一行添加: private MediaPlayer mp=new MediaPlayer();3.

2015-08-28 21:08:16 26787 16

原创 Android Studio App EditText获取输入的文字

用aedittext.getText().toString()获取输入的字符串。示范整个activity_mani.xmln内容如下:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"

2015-08-28 16:33:37 32709 4

原创 Android Studio App设置线性布局LinerLayout控件占屏幕长宽比例

如何设置两个控件在水平方向上的占屏幕的比例?1.要有线性布局LinerLayout2.设置线性布局控件水平排列:android:orientation="horizontal"3.设置第一个控件:android:layout_width="0dp"android:layout_weight="6"第二个控件:android:layout_width="0dp"andro

2015-08-28 15:59:01 16336

原创 Android Studio App设置线性布局LinerLayout控件垂直/水平方向排列

1.线型布局用LinearLayout2.让控件垂直方向排列用android:orientation="vertical"注意此时内部控件不能将高度指定为fill_parent和match_parent,因为这样一个控件就把屏幕垂直方向全部占满了,没有其它控件的空间。垂直方向排列控件的整个xml内容范例如下:<LinearLayout xmlns:android="http:/

2015-08-28 15:26:04 49293

原创 Android Studio App隐藏标题栏

IDE是Android Studio。1.把MainActivity.java文件里的public class MainActivity extends ActionBarActivity改为public class MainActivity extends Activity2.在super.onCreate(savedInstanceState);语句下面添加re

2015-08-27 11:43:46 2057

原创 Android Studio App设置Notification通知

1.在maniactivity.java文件里添加:NotificationManager manager=(NotificationManager)getSystemService(NOTIFICATION_SERVICE);//NotificationManager实例对通知进行管理Notification notification=new Notification(R.drawable

2015-08-25 22:16:17 8970

原创 Android Studio App设置TextView文字内容大小颜色

设置TextView文字内容大小颜色1.第一种方法在activity_main.xml李设置,Java文件不用改:android:text="这里是文字"android:textSize="字体大小"android:textColor="颜色代码"整个xml内容如下:<RelativeLayout xmlns:android="http://schemas.andr

2015-08-21 10:16:10 60307 1

原创 Android Studio App设置Activity背景图片

1.首先PC上要有一张png格式的图片,复制它,注意图片名字(只能含小写字母a~z和数字0~9,".png“要小写),粘贴进drawable文件夹。 2.在activity_main.xml里添加下面一句,注意添加位置,/drawable/+图片名称。 android:background="@drawable/backimg"整个activity_main.xml内...

2015-08-21 08:42:33 64587 6

原创 Android Studio Toast/Notification中文乱码解决办法

在build.grade (Modul: app)文件里添加一面一句:android{compileOptions.encoding="GBK"}整个build.grade (Modul: app)内容如下:apply plugin: 'com.android.application'android { compileSdkVersion 22 buildToolsVe

2015-08-19 21:51:04 5060 1

原创 Android app布局TableLayout范例

<TableLayout 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"

2015-08-19 20:46:33 791

原创 Android App添加按钮事件

IDE是Android studio.

2015-08-19 20:03:37 6524

原创 浙江大学PAT_甲级_1081. Rational Sum (20)

题目链接:点击打开链接Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum.Input Specification:Each input file contains one test case. Each case sta

2015-08-19 15:28:27 648

原创 Android App更改背景颜色

在activit_main.xml文件里添加:android:background="#00BFFF"

2015-08-19 07:19:14 19181

原创 浙江大学PAT_甲级_1073. Scientific Notation (20)

题目链接:点击打开链接Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9]"."[0-9]+E[+-][0-9]+ which

2015-08-18 16:52:08 336

原创 浙江大学PAT_甲级_1096. Consecutive Factors (20)

C++

2015-08-18 16:45:59 434

原创 浙江大学PAT_甲级_1077. Kuchiguse (20)

C++

2015-08-18 14:16:32 560

原创 C语言结构体排序方法

#include "stdafx.h"#include#include#includeusing namespace std;struct student{ string name;//姓名 int math;//数学成绩 int english;//英语};int c =0;//控制排序规则bool compare(student a, student b){ if

2015-08-17 16:13:18 19586 7

原创 浙江大学PAT_甲级_1028. List Sorting (25)

C++

2015-08-17 14:46:18 579

原创 浙江大学PAT_甲级_1015. Reversible Primes (20)

java

2015-08-17 06:52:25 429

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除