使用很简单,只需继承SupportActivity,并在清单中加入android:theme="@android:style/Theme.Translucent"即可
package com.support;
import com.nineoldandroids.animation.Animator;
import com.nineoldandroids.animation.An...
分类:
其他好文 时间:
2015-05-06 22:56:44
阅读次数:
535
方法一:通过Theme.Translucent@android:style/Theme.Translucent @android:style/Theme.Translucent.NoTitleBar @android:style/Theme.Translu...
分类:
移动开发 时间:
2015-04-14 16:01:34
阅读次数:
200
在activity中调用以下方法:
/**
* Apply KitKat specific translucency.
*/
private void applyKitKatTranslucency() {
// KitKat translucent navigation/status bar.
if (Build.VERSI...
分类:
其他好文 时间:
2015-03-29 13:39:46
阅读次数:
204
android 常用代码片段,前1-10条是从网上摘录,向原作者致谢。后面为自己整理。1、设置窗口格式为半透明
getWindow().setFormat(PixelFormat.TRANSLUCENT);
2、Android中在非UI线程里更新View的不同方法:
* Activity.runOnUiThread( Runnable )
* View.post( Runnable )...
分类:
移动开发 时间:
2015-03-09 16:19:14
阅读次数:
367
通知栏透明效果如图:
而通知栏不透明的效果是这样子的:
但是这个效果只在4.4+才支持
getWindow().addFlag(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);demo如下:
@Override
protected void onCreate(Bundle savedInstanceState) {...
分类:
移动开发 时间:
2015-03-03 18:36:02
阅读次数:
174
/*对系统版本为4.4及以上的开启 透明状态栏和导航栏(即沉浸式状态栏)*/
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window window = getWindow();
// Translucent status bar
window....
分类:
其他好文 时间:
2015-02-06 16:53:11
阅读次数:
120
self.navigationController.navigationBar.translucent = YES;// 设置bar透明[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"...
分类:
其他好文 时间:
2015-01-12 16:04:28
阅读次数:
102
我用的是高德的3D地图,用2D地图无此问题。
从答案来看,大概是SurfactView与Fragment之间的问题。虽然我用的是高德,不过这方法估计对百度地图也有效。
解决方法是,在使用到地图的Activity中的onCreate中添加以下代码:
getWindow().setFormat(PixelFormat.TRANSLUCENT);...
分类:
其他好文 时间:
2015-01-06 20:10:14
阅读次数:
128
"添加到主屏幕“后,全屏显示 这meta的作用就是删除默认的苹果工具栏和菜单栏。content有两个值”yes”和”no”,当我们需要显示工具栏和菜单栏时,这个行meta就不用加了,默认就是显示。 默认值为default(白色),可以定为black(黑色)和black-translucent(灰色半...
分类:
移动开发 时间:
2015-01-05 10:56:08
阅读次数:
134
在AndroidManifest.xml中相应的activity标签处添加如下内容即可得到透明Activity:
android:theme="@android:style/Theme.Translucent"
示例如下:
<?xmlversion="1.0"encoding="utf-8"?>
<manifestxmlns:android="http://schemas.android.com/apk/res/android"
pack..
分类:
移动开发 时间:
2014-12-26 14:50:41
阅读次数:
197