我在我的應用程序中製作了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