欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android自定義狀態(tài)欄顏色與APP風(fēng)格保持一致的實現(xiàn)方法

 更新時間:2016年10月13日 13:44:08   作者:Aaron0619  
我們知道iOS上的應(yīng)用,狀態(tài)欄的顏色總能與應(yīng)用標(biāo)題欄顏色保持一致,用戶體驗很不錯,那安卓是否可以呢?下面小編給大家?guī)砹薃ndroid自定義狀態(tài)欄顏色與APP風(fēng)格保持一致的實現(xiàn)方法,跟著小編一起學(xué)習(xí)吧

我們知道iOS上的應(yīng)用,狀態(tài)欄的顏色總能與應(yīng)用標(biāo)題欄顏色保持一致,用戶體驗很不錯,那安卓是否可以呢?若是在安卓4.4之前,答案是否定的,但在4.4之后,谷歌允許開發(fā)者自定義狀態(tài)欄背景顏色啦,這是個不錯的體驗!若你手機上安裝有最新版的qq,并且你的安卓SDK版本是4.4及以上,你可以看下它的效果:

實現(xiàn)此功能有兩種方法:

1.在xml中設(shè)置主題或自定義style;

Theme.Holo.Light.NoActionBar.TranslucentDecor
Theme.Holo.NoActionBar.TranslucentDecor
<style name="AppTheme" parent="AppBaseTheme"> 
<!-- Status Bar --> 
<item name="android:windowTranslucentStatus">true</item> 
<!-- Navigation Bar --> 
<item name="android:windowTranslucentNavigation">true</item> 
</style>

鑒于市面上各種手機的SDK的各種版本,不建議采用這種方法;

2.在代碼中控制;

可以首先創(chuàng)建一個BaseActivity,在onCreate方法中進行處理:

@Override 
protected void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState); 
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { 
setTranslucentStatus(true); 
SystemBarTintManager tintManager = new SystemBarTintManager(this); 
tintManager.setStatusBarTintEnabled(true); 
tintManager.setStatusBarTintResource(R.color.top_bg_color);//通知欄所需顏色 
} 
setContentView(R.layout.main_activity); 
} 
@TargetApi(19) 
private void setTranslucentStatus(boolean on) { 
Window win = getWindow(); 
WindowManager.LayoutParams winParams = win.getAttributes(); 
final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; 
if (on) { 
winParams.flags |= bits; 
} else { 
winParams.flags &= ~bits; 
} 
win.setAttributes(winParams); 
}

需注意的是, tintManager.setStatusBarTintResource(R.color.top_bg_color);這一步的顏色值(即把你的狀態(tài)欄顏色與你的標(biāo)題欄顏色保持一致)要寫在color.xml中去,如果用Color.praseColor則會報錯。

SystemBarTintManager.Java源碼:

import android.annotation.SuppressLint; 
import android.annotation.TargetApi; 
import android.app.Activity; 
import android.content.Context; 
import android.content.res.Configuration; 
import android.content.res.Resources; 
import android.content.res.TypedArray; 
import android.graphics.drawable.Drawable; 
import android.os.Build; 
import android.util.DisplayMetrics; 
import android.util.TypedValue; 
import android.view.Gravity; 
import android.view.View; 
import android.view.ViewConfiguration; 
import android.view.ViewGroup; 
import android.view.Window; 
import android.view.WindowManager; 
import android.widget.FrameLayout.LayoutParams; 
import java.lang.reflect.Method; 
/** 
* Class to manage status and navigation bar tint effects when using KitKat 
* translucent system UI modes. 
* 
*/ 
@SuppressWarnings({ "rawtypes", "unchecked" }) 
public class SystemBarTintManager { 
static { 
// Android allows a system property to override the presence of the navigation bar. 
// Used by the emulator. 
// See https://github.com/android/platform_frameworks_base/blob/master/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java#L1076 
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { 
try { 
Class c = Class.forName("android.os.SystemProperties"); 
Method m = c.getDeclaredMethod("get", String.class); 
m.setAccessible(true); 
sNavBarOverride = (String) m.invoke(null, "qemu.hw.mainkeys"); 
} catch (Throwable e) { 
sNavBarOverride = null; 
} 
} 
} 
/** 
* The default system bar tint color value. 
*/ 
public static final int DEFAULT_TINT_COLOR = 0x99000000; 
private static String sNavBarOverride; 
private final SystemBarConfig mConfig; 
private boolean mStatusBarAvailable; 
private boolean mNavBarAvailable; 
private boolean mStatusBarTintEnabled; 
private boolean mNavBarTintEnabled; 
private View mStatusBarTintView; 
private View mNavBarTintView; 
/** 
* Constructor. Call this in the host activity onCreate method after its 
* content view has been set. You should always create new instances when 
* the host activity is recreated. 
* 
* @param activity The host activity. 
*/ 
@TargetApi(19) 
public SystemBarTintManager(Activity activity) { 
Window win = activity.getWindow(); 
ViewGroup decorViewGroup = (ViewGroup) win.getDecorView(); 
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { 
// check theme attrs 
int[] attrs = {android.R.attr.windowTranslucentStatus, 
android.R.attr.windowTranslucentNavigation}; 
TypedArray a = activity.obtainStyledAttributes(attrs); 
try { 
mStatusBarAvailable = a.getBoolean(0, false); 
mNavBarAvailable = a.getBoolean(1, false); 
} finally { 
a.recycle(); 
} 
// check window flags 
WindowManager.LayoutParams winParams = win.getAttributes(); 
int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; 
if ((winParams.flags & bits) != 0) { 
mStatusBarAvailable = true; 
} 
bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION; 
if ((winParams.flags & bits) != 0) { 
mNavBarAvailable = true; 
} 
} 
mConfig = new SystemBarConfig(activity, mStatusBarAvailable, mNavBarAvailable); 
// device might not have virtual navigation keys 
if (!mConfig.hasNavigtionBar()) { 
mNavBarAvailable = false; 
} 
if (mStatusBarAvailable) { 
setupStatusBarView(activity, decorViewGroup); 
} 
if (mNavBarAvailable) { 
setupNavBarView(activity, decorViewGroup); 
} 
} 
/** 
* Enable tinting of the system status bar. 
* 
* If the platform is running Jelly Bean or earlier, or translucent system 
* UI modes have not been enabled in either the theme or via window flags, 
* then this method does nothing. 
* 
* @param enabled True to enable tinting, false to disable it (default). 
*/ 
public void setStatusBarTintEnabled(boolean enabled) { 
mStatusBarTintEnabled = enabled; 
if (mStatusBarAvailable) { 
mStatusBarTintView.setVisibility(enabled ? View.VISIBLE : View.GONE); 
} 
} 
/** 
* Enable tinting of the system navigation bar. 
* 
* If the platform does not have soft navigation keys, is running Jelly Bean 
* or earlier, or translucent system UI modes have not been enabled in either 
* the theme or via window flags, then this method does nothing. 
* 
* @param enabled True to enable tinting, false to disable it (default). 
*/ 
public void setNavigationBarTintEnabled(boolean enabled) { 
mNavBarTintEnabled = enabled; 
if (mNavBarAvailable) { 
mNavBarTintView.setVisibility(enabled ? View.VISIBLE : View.GONE); 
} 
} 
/** 
* Apply the specified color tint to all system UI bars. 
* 
* @param color The color of the background tint. 
*/ 
public void setTintColor(int color) { 
setStatusBarTintColor(color); 
setNavigationBarTintColor(color); 
} 
/** 
* Apply the specified drawable or color resource to all system UI bars. 
* 
* @param res The identifier of the resource. 
*/ 
public void setTintResource(int res) { 
setStatusBarTintResource(res); 
setNavigationBarTintResource(res); 
} 
/** 
* Apply the specified drawable to all system UI bars. 
* 
* @param drawable The drawable to use as the background, or null to remove it. 
*/ 
public void setTintDrawable(Drawable drawable) { 
setStatusBarTintDrawable(drawable); 
setNavigationBarTintDrawable(drawable); 
} 
/** 
* Apply the specified alpha to all system UI bars. 
* 
* @param alpha The alpha to use 
*/ 
public void setTintAlpha(float alpha) { 
setStatusBarAlpha(alpha); 
setNavigationBarAlpha(alpha); 
} 
/** 
* Apply the specified color tint to the system status bar. 
* 
* @param color The color of the background tint. 
*/ 
public void setStatusBarTintColor(int color) { 
if (mStatusBarAvailable) { 
mStatusBarTintView.setBackgroundColor(color); 
} 
} 
/** 
* Apply the specified drawable or color resource to the system status bar. 
* 
* @param res The identifier of the resource. 
*/ 
public void setStatusBarTintResource(int res) { 
if (mStatusBarAvailable) { 
mStatusBarTintView.setBackgroundResource(res); 
} 
} 
/** 
* Apply the specified drawable to the system status bar. 
* 
* @param drawable The drawable to use as the background, or null to remove it. 
*/ 
@SuppressWarnings("deprecation") 
public void setStatusBarTintDrawable(Drawable drawable) { 
if (mStatusBarAvailable) { 
mStatusBarTintView.setBackgroundDrawable(drawable); 
} 
} 
/** 
* Apply the specified alpha to the system status bar. 
* 
* @param alpha The alpha to use 
*/ 
@TargetApi(11) 
public void setStatusBarAlpha(float alpha) { 
if (mStatusBarAvailable && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { 
mStatusBarTintView.setAlpha(alpha); 
} 
} 
/** 
* Apply the specified color tint to the system navigation bar. 
* 
* @param color The color of the background tint. 
*/ 
public void setNavigationBarTintColor(int color) { 
if (mNavBarAvailable) { 
mNavBarTintView.setBackgroundColor(color); 
} 
} 
/** 
* Apply the specified drawable or color resource to the system navigation bar. 
* 
* @param res The identifier of the resource. 
*/ 
public void setNavigationBarTintResource(int res) { 
if (mNavBarAvailable) { 
mNavBarTintView.setBackgroundResource(res); 
} 
} 
/** 
* Apply the specified drawable to the system navigation bar. 
* 
* @param drawable The drawable to use as the background, or null to remove it. 
*/ 
@SuppressWarnings("deprecation") 
public void setNavigationBarTintDrawable(Drawable drawable) { 
if (mNavBarAvailable) { 
mNavBarTintView.setBackgroundDrawable(drawable); 
} 
} 
/** 
* Apply the specified alpha to the system navigation bar. 
* 
* @param alpha The alpha to use 
*/ 
@TargetApi(11) 
public void setNavigationBarAlpha(float alpha) { 
if (mNavBarAvailable && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { 
mNavBarTintView.setAlpha(alpha); 
} 
} 
/** 
* Get the system bar configuration. 
* 
* @return The system bar configuration for the current device configuration. 
*/ 
public SystemBarConfig getConfig() { 
return mConfig; 
} 
/** 
* Is tinting enabled for the system status bar? 
* 
* @return True if enabled, False otherwise. 
*/ 
public boolean isStatusBarTintEnabled() { 
return mStatusBarTintEnabled; 
} 
/** 
* Is tinting enabled for the system navigation bar? 
* 
* @return True if enabled, False otherwise. 
*/ 
public boolean isNavBarTintEnabled() { 
return mNavBarTintEnabled; 
} 
private void setupStatusBarView(Context context, ViewGroup decorViewGroup) { 
mStatusBarTintView = new View(context); 
LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, mConfig.getStatusBarHeight()); 
params.gravity = Gravity.TOP; 
if (mNavBarAvailable && !mConfig.isNavigationAtBottom()) { 
params.rightMargin = mConfig.getNavigationBarWidth(); 
} 
mStatusBarTintView.setLayoutParams(params); 
mStatusBarTintView.setBackgroundColor(DEFAULT_TINT_COLOR); 
mStatusBarTintView.setVisibility(View.GONE); 
decorViewGroup.addView(mStatusBarTintView); 
} 
private void setupNavBarView(Context context, ViewGroup decorViewGroup) { 
mNavBarTintView = new View(context); 
LayoutParams params; 
if (mConfig.isNavigationAtBottom()) { 
params = new LayoutParams(LayoutParams.MATCH_PARENT, mConfig.getNavigationBarHeight()); 
params.gravity = Gravity.BOTTOM; 
} else { 
params = new LayoutParams(mConfig.getNavigationBarWidth(), LayoutParams.MATCH_PARENT); 
params.gravity = Gravity.RIGHT; 
} 
mNavBarTintView.setLayoutParams(params); 
mNavBarTintView.setBackgroundColor(DEFAULT_TINT_COLOR); 
mNavBarTintView.setVisibility(View.GONE); 
decorViewGroup.addView(mNavBarTintView); 
} 
/** 
* Class which describes system bar sizing and other characteristics for the current 
* device configuration. 
* 
*/ 
public static class SystemBarConfig { 
private static final String STATUS_BAR_HEIGHT_RES_NAME = "status_bar_height"; 
private static final String NAV_BAR_HEIGHT_RES_NAME = "navigation_bar_height"; 
private static final String NAV_BAR_HEIGHT_LANDSCAPE_RES_NAME = "navigation_bar_height_landscape"; 
private static final String NAV_BAR_WIDTH_RES_NAME = "navigation_bar_width"; 
private static final String SHOW_NAV_BAR_RES_NAME = "config_showNavigationBar"; 
private final boolean mTranslucentStatusBar; 
private final boolean mTranslucentNavBar; 
private final int mStatusBarHeight; 
private final int mActionBarHeight; 
private final boolean mHasNavigationBar; 
private final int mNavigationBarHeight; 
private final int mNavigationBarWidth; 
private final boolean mInPortrait; 
private final float mSmallestWidthDp; 
private SystemBarConfig(Activity activity, boolean translucentStatusBar, boolean traslucentNavBar) { 
Resources res = activity.getResources(); 
mInPortrait = (res.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT); 
mSmallestWidthDp = getSmallestWidthDp(activity); 
mStatusBarHeight = getInternalDimensionSize(res, STATUS_BAR_HEIGHT_RES_NAME); 
mActionBarHeight = getActionBarHeight(activity); 
mNavigationBarHeight = getNavigationBarHeight(activity); 
mNavigationBarWidth = getNavigationBarWidth(activity); 
mHasNavigationBar = (mNavigationBarHeight > 0); 
mTranslucentStatusBar = translucentStatusBar; 
mTranslucentNavBar = traslucentNavBar; 
} 
@TargetApi(14) 
private int getActionBarHeight(Context context) { 
int result = 0; 
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { 
TypedValue tv = new TypedValue(); 
context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true); 
result = TypedValue.complexToDimensionPixelSize(tv.data, context.getResources().getDisplayMetrics()); 
} 
return result; 
} 
@TargetApi(14) 
private int getNavigationBarHeight(Context context) { 
Resources res = context.getResources(); 
int result = 0; 
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { 
if (hasNavBar(context)) { 
String key; 
if (mInPortrait) { 
key = NAV_BAR_HEIGHT_RES_NAME; 
} else { 
key = NAV_BAR_HEIGHT_LANDSCAPE_RES_NAME; 
} 
return getInternalDimensionSize(res, key); 
} 
} 
return result; 
} 
@TargetApi(14) 
private int getNavigationBarWidth(Context context) { 
Resources res = context.getResources(); 
int result = 0; 
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { 
if (hasNavBar(context)) { 
return getInternalDimensionSize(res, NAV_BAR_WIDTH_RES_NAME); 
} 
} 
return result; 
} 
@TargetApi(14) 
private boolean hasNavBar(Context context) { 
Resources res = context.getResources(); 
int resourceId = res.getIdentifier(SHOW_NAV_BAR_RES_NAME, "bool", "android"); 
if (resourceId != 0) { 
boolean hasNav = res.getBoolean(resourceId); 
// check override flag (see static block) 
if ("1".equals(sNavBarOverride)) { 
hasNav = false; 
} else if ("0".equals(sNavBarOverride)) { 
hasNav = true; 
} 
return hasNav; 
} else { // fallback 
return !ViewConfiguration.get(context).hasPermanentMenuKey(); 
} 
} 
private int getInternalDimensionSize(Resources res, String key) { 
int result = 0; 
int resourceId = res.getIdentifier(key, "dimen", "android"); 
if (resourceId > 0) { 
result = res.getDimensionPixelSize(resourceId); 
} 
return result; 
} 
@SuppressLint("NewApi") 
private float getSmallestWidthDp(Activity activity) { 
DisplayMetrics metrics = new DisplayMetrics(); 
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { 
activity.getWindowManager().getDefaultDisplay().getRealMetrics(metrics); 
} else { 
// TODO this is not correct, but we don't really care pre-kitkat 
activity.getWindowManager().getDefaultDisplay().getMetrics(metrics); 
} 
float widthDp = metrics.widthPixels / metrics.density; 
float heightDp = metrics.heightPixels / metrics.density; 
return Math.min(widthDp, heightDp); 
} 
/** 
* Should a navigation bar appear at the bottom of the screen in the current 
* device configuration? A navigation bar may appear on the right side of 
* the screen in certain configurations. 
* 
* @return True if navigation should appear at the bottom of the screen, False otherwise. 
*/ 
public boolean isNavigationAtBottom() { 
return (mSmallestWidthDp >= 600 || mInPortrait); 
} 
/** 
* Get the height of the system status bar. 
* 
* @return The height of the status bar (in pixels). 
*/ 
public int getStatusBarHeight() { 
return mStatusBarHeight; 
} 
/** 
* Get the height of the action bar. 
* 
* @return The height of the action bar (in pixels). 
*/ 
public int getActionBarHeight() { 
return mActionBarHeight; 
} 
/** 
* Does this device have a system navigation bar? 
* 
* @return True if this device uses soft key navigation, False otherwise. 
*/ 
public boolean hasNavigtionBar() { 
return mHasNavigationBar; 
} 
/** 
* Get the height of the system navigation bar. 
* 
* @return The height of the navigation bar (in pixels). If the device does not have 
* soft navigation keys, this will always return 0. 
*/ 
public int getNavigationBarHeight() { 
return mNavigationBarHeight; 
} 
/** 
* Get the width of the system navigation bar when it is placed vertically on the screen. 
* 
* @return The width of the navigation bar (in pixels). If the device does not have 
* soft navigation keys, this will always return 0. 
*/ 
public int getNavigationBarWidth() { 
return mNavigationBarWidth; 
} 
/** 
* Get the layout inset for any system UI that appears at the top of the screen. 
* 
* @param withActionBar True to include the height of the action bar, False otherwise. 
* @return The layout inset (in pixels). 
*/ 
public int getPixelInsetTop(boolean withActionBar) { 
return (mTranslucentStatusBar ? mStatusBarHeight : 0) + (withActionBar ? mActionBarHeight : 0); 
} 
/** 
* Get the layout inset for any system UI that appears at the bottom of the screen. 
* 
* @return The layout inset (in pixels). 
*/ 
public int getPixelInsetBottom() { 
if (mTranslucentNavBar && isNavigationAtBottom()) { 
return mNavigationBarHeight; 
} else { 
return 0; 
} 
} 
/** 
* Get the layout inset for any system UI that appears at the right of the screen. 
* 
* @return The layout inset (in pixels). 
*/ 
public int getPixelInsetRight() { 
if (mTranslucentNavBar && !isNavigationAtBottom()) { 
return mNavigationBarWidth; 
} else { 
return 0; 
} 
} 
} 
}

引用自:https://github.com/jgilfelt/SystemBarTint

代碼復(fù)制進你的項目即可,好了,這些工作完成之后我們來看下效果:

貌似已經(jīng)達(dá)到效果了,但仔細(xì)觀察,好像標(biāo)題欄被提上去了,就是說APP界面全屏了,狀態(tài)了蓋在了APP上,恩,這并非我們想要的效果,那如何將界面從狀態(tài)欄下部開始呢,只需要在Activity的布局文件最外層控件加上一個屬性:

Android:fitsSystemWindows="true"就可以啦!看下效果:

OK,大功告成!

PS:在使用過程中發(fā)現(xiàn)了一些問題,使用以上方法對單個Activity有效,但是對繼承了TabActivity的導(dǎo)航頁怎么辦呢?假如MainActivity繼承了TabActivity,Tab1Activity、Tab2Activity、Tab3Activity是三個子項,那么設(shè)置狀態(tài)欄的代碼需寫在MainActivity中,而 android:fitsSystemWindows="true"需寫在三個子Activity的xml布局文件中,這樣設(shè)置后仍然有問題,就是進入應(yīng)用后首頁也就是Tab1Activity沒有問題,而Tab2Activity、Tab3Activity卻沒達(dá)到效果,它們的效果相當(dāng)于未加android:fitsSystemWindows="true"時的效果,期初我懷疑是Activity不同的原因,因此我把Tab1Activity和Tab3Activity調(diào)了下位置,結(jié)果Tab3Activity成為首頁后正常,而Tab1Activity又不正常了,百思不得姐,最后實在沒辦法,就在Tab2Activity、Tab3Activity的OnCreate方法中加了幾句代碼:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { 
((LinearLayout)findViewById(R.id.ll)).setPadding(0, SysUtils.getStatusHeight(this), 0,0); 
}

意思是,先求出狀態(tài)欄高度,然后設(shè)置最外層控件的PaddingTop值為狀態(tài)欄高度,結(jié)果正好達(dá)到效果,至于為什么只有首頁Activity可以達(dá)到效果,而后面的子項無法達(dá)到效果,本人也在郁悶中,有知道的朋友可以分享下!

狀態(tài)欄高度算法:

/** 
* 狀態(tài)欄高度算法 
* @param activity 
* @return 
*/ 
public static int getStatusHeight(Activity activity){ 
int statusHeight = 0; 
Rect localRect = new Rect(); 
activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(localRect); 
statusHeight = localRect.top; 
if (0 == statusHeight){ 
Class<?> localClass; 
try { 
localClass = Class.forName("com.android.internal.R$dimen"); 
Object localObject = localClass.newInstance(); 
int i5 = Integer.parseInt(localClass.getField("status_bar_height").get(localObject).toString()); 
statusHeight = activity.getResources().getDimensionPixelSize(i5); 
} catch (ClassNotFoundException e) { 
e.printStackTrace(); 
} catch (IllegalAccessException e) { 
e.printStackTrace(); 
} catch (InstantiationException e) { 
e.printStackTrace(); 
} catch (NumberFormatException e) { 
e.printStackTrace(); 
} catch (IllegalArgumentException e) { 
e.printStackTrace(); 
} catch (SecurityException e) { 
e.printStackTrace(); 
} catch (NoSuchFieldException e) { 
e.printStackTrace(); 
} 
} 
return statusHeight; 
}

以上所述是小編給大家介紹的Android自定義狀態(tài)欄顏色與APP風(fēng)格保持一致的實現(xiàn)方法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關(guān)文章

  • Android中ListView異步加載圖片錯位、重復(fù)、閃爍問題分析及解決方案

    Android中ListView異步加載圖片錯位、重復(fù)、閃爍問題分析及解決方案

    在Android所有系統(tǒng)自帶的控件當(dāng)中,ListView這個控件算是用法比較復(fù)雜的了,關(guān)鍵是用法復(fù)雜也就算了,它還經(jīng)常會出現(xiàn)一些稀奇古怪的問題,讓人非常頭疼,下面通過本篇文章給大家分享Android中ListView異步加載圖片錯位、重復(fù)、閃爍問題分析及解決方案,需要朋友可以參考
    2015-08-08
  • Android Studio查看Android 5.x源碼的步驟詳解

    Android Studio查看Android 5.x源碼的步驟詳解

    Google為Android開發(fā)者帶來Android Studio,用來取代Eclipse。從Android Studio出現(xiàn)起,整機開發(fā)和Android源碼閱讀和編輯一定能用上它。這篇文章小編就帶大家學(xué)習(xí)下如何使用Android Studio查看Android 5.x源碼,有需要的可以參考借鑒。
    2016-09-09
  • Android RetainFragment狀態(tài)保存的方法

    Android RetainFragment狀態(tài)保存的方法

    本篇文章主要介紹了Android RetainFragment狀態(tài)保存的方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-02-02
  • android webView截圖的4種方法

    android webView截圖的4種方法

    這篇文章主要為大家詳細(xì)介紹了android webView截圖的4種方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-05-05
  • 如何使用Flutter實現(xiàn)手寫簽名效果

    如何使用Flutter實現(xiàn)手寫簽名效果

    Flutter插件提供了用于繪制平滑簽名的簽名板,下面這篇文章主要給大家介紹了關(guān)于如何使用Flutter實現(xiàn)手寫簽名效果的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2022-12-12
  • Android開發(fā)實現(xiàn)抽屜菜單

    Android開發(fā)實現(xiàn)抽屜菜單

    這篇文章主要為大家詳細(xì)介紹了Android開發(fā)實現(xiàn)抽屜菜單,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2021-11-11
  • Android使用Kotlin和RxJava 2.×實現(xiàn)短信驗證碼倒計時效果

    Android使用Kotlin和RxJava 2.×實現(xiàn)短信驗證碼倒計時效果

    本篇文章主要介紹了Android使用Kotlin和RxJava 2.×實現(xiàn)短信驗證碼倒計時效果,非常具有實用價值,需要的朋友可以參考下
    2017-12-12
  • Android將內(nèi)容分享到QQ和微信實例代碼

    Android將內(nèi)容分享到QQ和微信實例代碼

    這篇文章主要介紹了Android將內(nèi)容分享到QQ和微信實例代碼,非常不錯,具有參考借鑒價值,需要的朋友可以參考下
    2018-06-06
  • Android Rreact Native 常見錯誤總結(jié)

    Android Rreact Native 常見錯誤總結(jié)

    這篇文章主要介紹了Android Rreact Native 常見錯誤總結(jié)的相關(guān)資料,需要的朋友可以參考下
    2017-06-06
  • Gradle配置教程之自定義APK名稱與輸出路徑

    Gradle配置教程之自定義APK名稱與輸出路徑

    Gradle是一個基于JVM的富有突破性構(gòu)建工具,下面這篇文章主要給大家介紹了關(guān)于Gradle配置教程之自定義APK名稱與輸出路徑的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),需要的朋友可以參考借鑒,下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧。
    2018-03-03

最新評論