一、Error: Adb refused acommand
解決方案:Pleasekill and start adb server from console or terminal using following commands:
adb kill-server
adb start-server
在Debug下控制檯執行
二、Android開發去掉標題欄方法
網上各種方法都試了,均無效果,比如:
1、在代碼中實現:
在此方法setContentView(R.layout.main)之前加入:
requestWindowFeature(Window.FEATURE_NO_TITLE);標題欄就沒有了。
2、在AndroidManifest.xml中實現:
註冊Activity時加上如下的一句配置就可以實現。
<activity android:name=".Activity"
android:theme="@android:style/Theme.NoTitleBar"
></activity>
均無效
正確解決方案:
在AndroidManifest.xml中增加android:theme="@style/Theme.AppCompat.Light.NoActionBar"
將標題設置爲亮白色即可解決
三、Android中設置自己狀態欄寬度完全填滿父窗體
設置
android:paddingLeft="0dp" android:paddingRight="0dp" android:paddingTop="0dp"
同時爲防止圖片變形,將圖片加入到ImageView中,而不是直接在LinearLayout中設置android:background="@drawable/loginztl"
正確如下:
<LinearLayout android:id="@+id/LinearLayoutLoginZTL" android:layout_width="match_parent" android:layout_height="70dp" android:orientation="horizontal" android:paddingRight="0dp"> <ImageView android:id="@+id/imge2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/loginztl" /> </LinearLayout>