Android - 文章列表
-
解决gradle-xxx.all.zip 下载慢的问题
到https://services.gradle.org/distributions/下载对应版本,放到C:\Users\用户名\.gradle\wrapper\dists这个目录下
-
android edittext 设置为单行的方法
使用android:singleLing提示过时android:singleLine=true现在的方法是android:inputType=textandroid:lines=1
-
android 获得屏幕宽度与高度
android获得屏幕宽度与高度方法一:WindowManagermanager=this.getWindowManager();DisplayMetricsoutMetrics=newDisplayMetrics();manager.getDefaultDisplay().getMetrics(outMetrics);intwidth=outMetrics.widthPixels;intheig
-
android GridLayout 设置子元素的rowspan,colspan,并填充单元格
androidGridLayout设置子元素的rowspan,colspan,并填充单元格LinearLayoutlayout=LinearLayout(Activity_TableEdit.)GridLayout.LayoutParamslayoutParams=GridLayout.LayoutParams()layoutParams.=GridLayout.(currentRowfield.
-
Cleartext HTTP traffic to xxx not permitted
android请求http时报错:CleartextHTTPtraffictoxxxnotpermitted原因是AndroidP的系统上面默认所有Http的请求都被阻止了。解决方法在androidmanifest.xml的application标签上加入android:usesCleartextTraffic=true如下所示applicationandroid:allowBackup=true
-
android 右下角弹出1/4圆盘菜单的效果
android右下角弹出1/4圆盘菜单的效果具体效果如下所示1、默认状态下右下角显示一个加号2、点击后展开两层菜单,同时旋转加号,变成关闭符号demo下载地址http://download.csdn.net/download/xwt0511/10148781
-
android通过intent浏览图片的方法
Intentintent=newIntent(Intent.ACTION_VIEW);Uriuri=Uri.parse(MediaStore.Images.Media.insertImage(getContentResolver(),bmp,null,null));//将bitmap转换为uriintent.setDataAndType(uri,image/*);startActivity(int
-
android选择文件,通过uri获取文件真实地址的方法(兼容7.0)
1、发起选择文件的请求Intentintent=newIntent(Intent.ACTION_GET_CONTENT);intent.setType(*/*);intent.addCategory(Intent.CATEGORY_OPENABLE);((Activity)context).startActivityForResult(Intent.createChooser(intent,请选择
-
Android 7.0的手机在eclipse上无法显示logcat的解决方法
Android7.0的手机在eclipse上无法显示调试信息logcat的解决方法需要下载ADT-24.2.0下载地址:https://github.com/khaledev/ADT/releases或http://pan.baidu.com/s/1gfFX5HxADT使用方法下载文件后在Eclipse中点击目录HelpInstallNewSoftware...AddArchive...然后选择下
-
swift 播放网络音频
var audioPlayer:AVAudioPlayer!func playsong(musicdata:NSData){ do{ try audioPlayer = AVAudioPlayer(data: musicdata) audioPlayer.prepareToPlay() audioPlayer.play() }catch {&n