2014-08-29 7 views
1

환경 설정 화면을 보여주는 앱이 있습니다. 여기에 화면의 레이아웃입니다 :전체 화면 모드로 환경 설정 화면 표시 안드로이드

<?xml version="1.0" encoding="utf-8"?> 
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_gravity="center"> 
    <PreferenceCategory 
     android:summary="Alarm sound" 
     android:title="Select Sound"> 

     <RingtonePreference 
      android:id="@+id/ringtone" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:key="Alarm" 
      android:ringtoneType="notification|alarm" 
      android:showDefault="true" 
      android:summary="Alarm" /> 
    </PreferenceCategory> 

</PreferenceScreen> 

는 그리고 활동은 정말 간단하다 :

package zabolotnii.pavel.timer; 

import android.os.Bundle; 
import android.preference.PreferenceActivity; 


public class SoundSelect extends PreferenceActivity{ 

    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     addPreferencesFromResource(R.layout.sound_select); 

    } 
} 

당신이 볼 수있는, 그 설정하는 하나의 항목입니다. 나는 벨소리 환경 설정을 Preference 범주없이 직접 표시하거나이 화면을 전체 화면으로 표시하는 다른 방법을 시도했지만 아무 일도 일어나지 않았습니다. 이 화면을 더 작게 보이게 만드는 방법에 대해 알고 있습니까?

답변

0

은 당신의 활동에 고해상도/레이아웃/preference.xml에게

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

    <ListView 
     android:id="@+id/android:list" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" > 
    </ListView> 

</LinearLayout> 

변화를 만들

package zabolotnii.pavel.timer; 

    import android.os.Bundle; 
    import android.preference.PreferenceActivity; 


    public class SoundSelect extends PreferenceActivity{ 

    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 

    setContentView(R.layout.preference); 
    addPreferencesFromResource(R.layout.sound_select); 

    } 
} 
관련 문제