2017-04-10 2 views
0

Ich habe ein Problem mit meinem Android SeekBar, ich drücke an jedem Ort entlang der Bar und die Bar bewegt sich an diesen Ort, aber es entfernt nicht die alten Standorte, so dass ich einen seltsamen Ghosting-Effekt als im Bild gesehen.Android SeekBar alten Fortschritt nicht entfernt

Screen Capture from my device

hat jemand dieses vorher gesehen? oder weiß was es sein könnte?

mein Layout-Datei ist wie folgt

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <Button 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:id="@+id/opt_back_button" 
     android:text="@string/opt_back_button_text"/> 

    <SeekBar 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/opt_test_seek_bar" 
     android:layout_margin="10dp" 
     android:max="100" 
     android:progress="0" 
     android:secondaryProgress="0"/> 

</LinearLayout> 

und meine Haupt-Java-Datei ist

import android.content.Intent; 
import android.support.v7.app.AppCompatActivity; 
import android.os.Bundle; 
import android.widget.SeekBar; 
import android.widget.Toast; 

public class OptionsMenuActivity extends AppCompatActivity { 

@Override 
protected void onCreate(Bundle savedInstanceState) { 

    super.onCreate(savedInstanceState); 

    // set the content view to the options menu 
    setContentView(R.layout.options_menu); 

    // get string from intent that started this activity 
    Intent source_intent = getIntent(); 
    String message = source_intent.getStringExtra("games.longrun.toroidtussle.MESSAGE"); 

    // display the message as a toast 
    Toast test_toast = Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT); 
    test_toast.show(); 

    // initialise the listeners for this activity 
    initialise_listeners(); 
} 

    private void initialise_listeners() 
    { 
     // get reference to the seekbar 
     SeekBar test_bar = (SeekBar)findViewById(R.id.opt_test_seek_bar); 

     // set listener for seek bar events 
     test_bar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { 

      @Override 
      public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { 

      } 

      @Override 
      public void onStartTrackingTouch(SeekBar seekBar) { 

      } 

      @Override 
      public void onStopTrackingTouch(SeekBar seekBar) { 
       int progress = seekBar.getProgress(); 

       Toast.makeText(OptionsMenuActivity.this, "Progress = " + progress, Toast.LENGTH_SHORT).show(); 
      } 
     }); 
    } 
} 
+0

Bitte Code –

+0

bearbeitet meinen Beitrag posten. – SlyRaccoon

Antwort

0

Ich fand zufällig heraus, was das Problem dafür war.

Ich hatte einen Stil festgelegt, die die Zeile enthalten

, die ich

geändert
<item name="android:windowBackground">@color/black_overlay</item> 
Verwandte Themen