2016-06-04 6 views
3

refer imageAppCompatSeekBar Entfernung von linkem und rechtem Padding?

 <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 

      <com.SocialMob.CustomViews.CustomTextView 
       android:id="@+id/textViewCurrentDurationMusic" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:padding="@dimen/_3sdp" 
       android:singleLine="true" 
       android:text="01:00" 
       android:textColor="#AEAEAE"/> 

      <android.support.v7.widget.AppCompatSeekBar 
       android:id="@+id/seekBarMusic" 
       android:layout_width="0dp" 
       android:layout_height="wrap_content" 
       android:layout_weight="1" 
       android:max="100" 
       android:paddingLeft="0px" 
       android:thumbOffset="-1px" 
       android:paddingRight="0px" 
       android:progress="60" 
       android:layout_margin="0dp" 
       app:theme="@style/SeekBarTheme" 
       app:paddingEnd="0px" 
       app:paddingStart="0px" /> 

      <com.SocialMob.CustomViews.CustomTextView 
       android:id="@+id/textViewTotalDurationMusic" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:gravity="end" 
       android:padding="@dimen/_3sdp" 
       android:text="05:00" 
       android:textColor="#AEAEAE"/> 
     </LinearLayout> 

Am einen Musik-Player App zu tun, die SeekBar hat, möchte ich in beiden Enden SeekBar Pfund extra entfernen. Ich habe versucht 0 Padding, 0 Rand, -ve Padding und -ve Marge.

Antwort

10

Warum nicht versuchen, es durch java code.try den folgenden Beispielcode zu ändern.

seekBar.setPadding(0, 0, 0, 0); 

Dies kann Ihnen helfen.

4

Folgende Attribute festlegen.

android: paddingStart = "0DP" android: paddingEnd = "0DP"