написал простое приложение на Samsung sm-t311, а switch toggle виджет не виден. Подскажите в чем может быть проблема
Отрывок из активити-класса
Switch toggle = (Switch) findViewById(R.id.switch1);
toggle.setTextOn("On");
toggle.setTextOff("Off");
toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
// The toggle is enabled
} else {
// The toggle is disabled
}
}
});
Вся разметка :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:weightSum="1">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
android:id="@+id/myLabel"
tools:context=".MainActivity"
/>
<Switch
android:layout_width="148dp"
android:layout_height="50dp"
android:text="New Switch"
android:id="@+id/switch1"
android:layout_weight="0.14"
android:clickable="true"
/>
</LinearLayout>