2013-12-07 5 views
0

나는 다음과 같은 레이아웃을 사용버튼을 표시하도록 레이아웃을 수정하는 방법은 무엇입니까?

<?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="wrap_content" 
       android:gravity="center" 
       android:orientation="vertical" 
       android:padding="10dp"> 

     <TextView 
      android:id="@+id/wizard6_title" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:paddingBottom="10dp" 
      android:scrollbars="vertical" 
      android:text="@string/wizard6_title" 
      android:textColor="#0088cc" 
      android:textSize="20sp" 
      android:textStyle="bold" /> 
    <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_marginTop="0dp" 
      android:orientation="vertical" 
      android:layout_weight="1"> 
     <TextView 
      android:id="@+id/wizard6_text1" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:gravity="fill_horizontal" 
      android:scrollbars="vertical" 
      android:text="@string/wizard6_text1" 
      android:textSize="18sp" /> 
     <Button 
       android:id="@+id/wizard6_btn_file" 
       android:layout_height="wrap_content" 
       android:layout_width="match_parent" 
       android:text="@string/wizard6_btn_file" /> 
    </LinearLayout> 
    <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="10dp" 
      android:layout_marginBottom="10dp"> 
     <Button 
       android:id="@+id/wizard6_btn_back" 
       android:layout_width="0dp" 
       android:layout_height="wrap_content" 
       android:layout_weight="1" 
       android:text="@string/wizard_back" /> 
     <Button 
       android:id="@+id/wizard6_btn_next" 
       android:layout_width="0dp" 
       android:layout_height="wrap_content" 
       android:layout_weight="1" 
       android:text="@string/wizard_next" /> 
    </LinearLayout> 
</LinearLayout> 

wizard6_text1 텍스트 스크롤 (mTextView5.setMovementMethod(new ScrollingMovementMethod()))가,하지만 작은 화면에 남은 공간이 필요하고 wizard6_btn_file이 결과에 표시되지 않습니다. 어떻게 수정해야합니까?

+0

매니페스트에서 내 활동에 대해 를 시도하셨습니까? – Sigrlami

+0

@Sigrlami, 방금 시도 - 도움이되지 않습니다. –

+0

몇 가지 스크린 샷을 게시 할 수 있습니까? – Sigrlami

답변

1

언제든지 레이아웃 가중치를 설정하지 않았기 때문에 문제가 발생할 수 있습니다. Android는 기본적으로 0을 사용하므로 필요한 모든 공간을 차지합니다. 텍스트가 많은 텍스트 뷰에 추가해보세요.

android:layout_weight="1" 

희망이 있습니다. 도움이 되었기를 바랍니다.

+0

감사합니다. 도움이되었습니다. –

관련 문제