
安卓控件
大树学长
多年专业音响、乐器行业经验,PC端、MAC端、安卓端软件开发,精通上位机软件制作。
展开
-
安卓开发之Spinner
使用:sp1String[] st1= {"断开","连接"};ArrayAdapter adapter1 = new ArrayAdapter(getContext(),android.R.layout.simple_spinner_item,st1);//将可选内容和ArrayAdapter连接起来adapter1.setDropDownViewResource(android原创 2016-11-29 09:54:04 · 720 阅读 · 0 评论 -
安卓开发之WebView控件只用
XML <WebView android:id="@+id/webView" android:layout_width="match_parent" android:layout_height="match_parent"/>class WebView webView = (WebView) findViewById(R.id.webVi原创 2017-03-17 19:34:29 · 617 阅读 · 0 评论 -
安卓开发之Button
按钮按下、长按、松开三种状态:切换背景图片时使用setOnClickListener:按下setOnLongClickListener:长按setOnTouchListener:松开原创 2016-11-23 16:35:22 · 594 阅读 · 0 评论 -
安卓开发之添加按钮音效(使用SoundPool 添加音乐)
res文件下创建raw文件,这个文件是专门用来放置音乐文件的。这里只讲用mp3格式文件。申明:private SoundPool sp;//声明一个SoundPoolprivate int music;//定义一个整型用load();来设置suondIDonCreate中:sp= new SoundPool(10, AudioManager.STREAM_SYS原创 2016-11-26 21:20:25 · 2046 阅读 · 0 评论 -
安卓开发设置控件边框
drawable中添加shape的view_yuan_morelist.xml<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor原创 2016-12-16 14:47:17 · 530 阅读 · 0 评论 -
安卓开发之TextView
TextView属性名称描述android:autoLink设置是否当文本为URL链接/email/电话号码/map时,文本显示为可点击的链接。可选值(none/web/email/phone/map/all)android:autoText如果设置,将自动执行输入值的拼写纠正。此处无效果,在显示输入法并输入的时候起作用。android:bufferType指定getText()方式取原创 2016-11-04 15:04:17 · 1091 阅读 · 0 评论 -
安卓开发之控件的大小获取和动态改变
动态设置控件大小:其中的头文件不要弄错了:import android.view.ViewGroup.LayoutParams;LayoutParams para = bt1.getLayoutParams();//bt1为按钮para.width=200;//修改宽度para.height=300;//修改高度bt1.setLayoutParams(para); //设置修改后的原创 2016-11-23 14:02:31 · 528 阅读 · 0 评论 -
安卓开发之自定义SeekBar竖立类(顺时针逆时针旋转90度)
类名:VerticalSeekBarpublic class VerticalSeekBar extends SeekBar{ private boolean mIsDragging; private float mTouchDownY; private int mScaledTouchSlop; private boolean isInScrollingConta原创 2016-11-22 16:57:01 · 2269 阅读 · 0 评论 -
安卓开发之TabHost
设置TabHost位于底部:http://blog.youkuaiyun.com/bigtree_mfc/article/details/51094715使用:TabHost m = (TabHost)findViewById(R.id.tabhost); m.setup(); LayoutInflater i = LayoutInflater.from(this);原创 2016-11-21 11:45:15 · 390 阅读 · 0 评论 -
安卓开发之单选按钮
XML 中设置:android:id="@+id/RadioGroup1"android:orientation="vertical"android:layout_width="wrap_content"android:layout_height="wrap_content"> android:text="Normal" androi原创 2016-11-17 12:01:32 · 2860 阅读 · 0 评论 -
安卓开发之自绘spinner控件
自绘spinner控件原创 2017-03-09 09:41:09 · 353 阅读 · 0 评论