1.修改背景色
2.切换目录结构模式
3.To switch from Run to Debug, the app has to restart. Continue?
4.java.lang.IllegalStateException: You need to use a Theme.AppCompat theme
5.百分比布局的更改
6.版本更新带来的函数更新
7.设置各部件的宽度或高度权重时报错
1.修改背景色
原始的白色看着不是很舒服,此时可以使用软件自带的黑色背景。具体操作为:
File-settings-Appearance & Behavior-Appearance
在右边的theme中选择Darclua。
2.切换目录结构模式
一般用到的是Android 和 project两种(目前我已知)
3.To switch from Run to Debug, the app has to restart. Continue?
3.1在debug或者运行的时候,如果上一次运行结束后没有关闭手机模拟器中的helloworld程序的话,运行的小三角会是这样的:
如果之前debug现在要run,或者之前run现在要debug,便会出现提示:
此时如果懒得关就直接点restart app,想关的话就打开模拟器,进行下图操作
没出现那个×的话就等几秒,关掉之后可以看到,小三角下面的原点消失了。
3.2新版Android Studio 已经改变了运行图标,当程序在运行中,想要关闭重新运行时,如下图,直接点击红色方框,之后点击绿色小三角即可,不需要关闭手机模拟器
4.java.lang.IllegalStateException: You need to use a Theme.AppCompat theme
转自此链接
6.版本更新带来的函数更新
(1)ProgressDialog:用ProgressBar替代
(2)Fragment
//新版本
getSupportFragmentManager().beginTransaction().add(R.id.frameLayout,new Fragment()).commitAllowingStateLoss();
//旧版本
getFragmentManager().beginTransaction().add(R.id.frameLayout,new Fragment()).commitAllowingStateLoss();
7.设置各部件的宽度或高度权重时报错
代码:
android:layout_height="0dp"
android:layout_weight="1"
报错信息:
解决方法:
在其所在的父控件上设置方向。