获取状态栏高度 int height = 0; int resourceId = getApplicationContext().getResources().getIdentifier("status_bar_height", "dimen", "and 2020-03-10 文档
动态设置控件的高度 //取控件当前的布局参数 LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) imageView.getLayoutParams(); //设置宽度值 params. 2020-03-10 文档
隐藏状态栏 就一行代码: getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);//设置透明状态栏 还有其他的样式,参考 https://blog.csdn 2020-03-10 文档
bitmap相关 我们先来实现bitmap的剪切效果可以直接使用函数 不过我们需要进行px和dp的转换才可以。函数如下 /** * 根据手机的分辨率从 dp 的单位 转成为 px(像素) */ public static int dip2px(Co 2020-03-10 文档
设置高斯模糊效果 这个也是一个比较复杂的功能,安卓是没有模糊效果的,只有普通透明度。 自己实力菜,只能采用大佬的方案。http://wl9739.github.io/2016/07/14/%E6%95%99%E4%BD%A0%E4%B8%80%E5%88%8 2020-03-10 文档
安卓设置assets里的文件夹作为背景 直接使用下面的代码来实现就可以了。 try { InputStream is=getAssets().open("imgs/bg.png"); Bitmap bm= BitmapFactory.decodeStream(is); is 2020-03-10 文档
隐藏导航栏 有4种方式 在mainfest中定义android:theme="@android:style/Theme.NoTitleBar" 自定义style 使用代码if (getSupportActionBar() != null){ g 2020-03-10 文档