WEB开发网
开发学院手机开发Android 开发 Android标题栏TitleBar全攻略 阅读

Android标题栏TitleBar全攻略

 2010-08-20 01:57:00 来源:WEB开发网   
核心提示:} else {mLockIcon.setImageDrawable(d);mLockIcon.setVisibility(View.VISIBLE);}}void setProgress(int newProgress) {if (newProgress >= mHorizontalProgress.getMa

} else {

mLockIcon.setImageDrawable(d);

mLockIcon.setVisibility(View.VISIBLE);

}

}

void setProgress(int newProgress) {

if (newProgress >= mHorizontalProgress.getMax()) {

mTitle.setCompoundDrawables(null, null, null, null);

((Animatable) mCircularProgress).stop();

mHorizontalProgress.setVisibility(View.INVISIBLE);

if (mBookmarkDrawable != null) {

mRtButton.setImageDrawable(mBookmarkDrawable);

}

mInLoad = false;

} else {

mHorizontalProgress.setProgress(newProgress);

if (!mInLoad && getWindowToken() != null) {

mTitle.setCompoundDrawables(null, null, mCircularProgress,

null);

((Animatable) mCircularProgress).start();

mHorizontalProgress.setVisibility(View.VISIBLE);

if (mBookmarkDrawable == null) {

mBookmarkDrawable = mRtButton.getDrawable();

}

if (mStopDrawable == null) {

mRtButton.setImageResource(R.drawable.ic_btn_stop_v2);

mStopDrawable = mRtButton.getDrawable();

} else {

mRtButton.setImageDrawable(mStopDrawable);

}

mInLoad = true;

}

}

}

void setTitleAndUrl(CharSequence title, CharSequence url) {

if (url == null) {

mTitle.setText(R.string.title_bar_loading);

} else {

mTitle.setText(url.toString());

}

}

void setToTabPicker() {

mTitle.setText(R.string.tab_picker_title);

setFavicon(null);

setLock(null);

mHorizontalProgress.setVisibility(View.GONE);

}

}

本文的相关的title_bar.xml布局文件内容,其中大家可以理解下部分图标在创建时使用隐藏GONE的visibility显示属性,通 过条件来设置其显示

< LinearLayout

上一页  1 2 3 4 5 6  下一页

Tags:Android 标题 TitleBar

编辑录入:coldstar [复制链接] [打 印]
赞助商链接