Android开发中遇到的一些小问题

一、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>
 

 

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小咖~

码字不易,感谢您的打赏

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值