2015-10-18 61 views
0

我的開關控件有問題。它們在某些設備上沒有正確顯示。請看下面的圖片:Android:三星設備上的開關控件無法正確顯示

enter image description here

而且它的代碼:

<LinearLayout 
    android:orientation="horizontal" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 
    <Switch       
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="Full screen" 
     android:id="@+id/optionFullscreen" 
     android:layout_margin="10dp" 
     android:onClick="onOptionBtClick" 
     android:checked="false" /> 
</LinearLayout> 

能否請你幫忙,是有可能使這一ON/OFF觸發最大寬度不會超過約40% ?

+0

PL分享您的完整的XML,而不僅僅是切換我已經編輯我的職務部分 –

+0

。請參見。此問題僅在三星設備上。該開關非常寬。如何減少其寬度? – ViH

+0

我還沒有找到解決方案。很奇怪 ( – ViH

回答

1

問題是與長文本。我解決它通過設置我自己的文字:

android:textOn="I" 
android:textOff="O" 
0

您可以在交換機小部件上設置android:switchMinWidth="50dp"屬性。這將使它更小

相關問題