我在我的应用程序中制作了Splash Screen
。我必须在我的启动画面中设置ProgressBar
。但ProgressBar
显示绿色,我必须设置白色使用代码但它工作后一段时间。首先它显示绿色然后它变成白色。Android Splash Screen ProgressBar颜色不变
创建ProgressBar
我已使用此https://github.com/rahatarmanahmed/CircularProgressView 任何帮助被赞赏。
Java代码:
public class SplashScreenActivity extends Activity {
// Set Duration of the Splash Screen
CircularProgressView progressView;
private static int SPLASH_TIME_OUT = 3000;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Remove the Title Bar
requestWindowFeature(Window.FEATURE_NO_TITLE);
// Get the view from splash_screen.xml
setContentView(R.layout.splash_screen);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
progressView = (CircularProgressView) findViewById(R.id.progress_view);
progressView.setColor(Color.parseColor("#FFFFFF"));
finish();
Intent myIntent = new Intent(SplashScreenActivity.this,
MainActivity.class);
startActivity(myIntent);
}
}, SPLASH_TIME_OUT);
}
}
能否请你加上你的代码是如何以身作则向上?这将使得提供一些帮助变得更容易。看起来有一些线程问题。 – jaolstad
你可以分享你的代码,并请突出显示它出错的地方。 –
@ destination-data我已经添加了代码,并且以自己的方式让它不使用任何示例。 – Harshad