开发者

progressbar is not displaying in title bar

I am using the following code, but my progress bar is not displaying in title bar instead displaying in my activiy top right corner

    <ProgressBar 
android:id="@+id/progress_bar" style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:lay开发者_运维百科out_height="wrap_content"
android:layout_centerVertical="true"

android:layout_marginRight="5dp" />

in code

//requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.welcome_layout);

Can any one plz help me out in this ..


You should either create your own ProgressBar or use one in the title bar. So, in your case, you don't need this ProgressBar definition in the layout file. Just do the following:

requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); 
setProgressBarIndeterminateVisibility(true);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜