0

저는 최근에 안드로이드 응용 프로그램에서 작업 해 왔으며, 마지막 날 또는 그 전에는 Eclipse 레이아웃 편집기를 사용하여 GUI 작업을하고있었습니다. 불행히도 x- 차원이 아닌 다른 방법으로 선형 레이아웃의 크기를 조정할 수 없습니다. 또한 TextView의 크기를 조정하여 크기를 조정할 수 있습니다. 수 실이 언급했듯이, 나는 직선형 레이아웃의 높이를 제어 할 수 없다. 내 코드 :안드로이드는 LinearLayout의 크기를 조정할 수 없습니다

<?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" > 

    <ScrollView 
     android:id="@+id/scrollView" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_weight="1" > 

     <LinearLayout 
      android:id="@+id/helpLinearLayout" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_gravity="top" 
      android:orientation="horizontal" > 

      <TextView 
       android:id="@+id/InfoTitle" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Info:" 
       android:textSize="35sp" /> 
     </LinearLayout> 

    </ScrollView> 

</LinearLayout> 

답변

2

시도해보십시오. 이것은 [fill_parent가되지 않습니다] 때문에 좋은 생각이다 ScrollView

<ScrollView 
      android:id="@+id/scrollView" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:fillViewport="true"> 
+0

그 트릭을 한 것으로 나타납니다. 고맙습니다! 편집 : 아니, 이제는 내 textview 전혀 이동할 수 없습니다. –

+2

당신은'fill_parent' 대신에'match_parent'를 계속 사용해야합니다 – Androiderson

+0

@ dylanisawesome1 당신이 그것을 옮길 수 없다는 것은 무엇을 의미합니까? – nedaRM

-2

은 내가 당신이 원하는 것을 이해 알고 있지만,이 변경하려고 돈`t이에

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" > 

을 :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:orientation="vertical" > 

이 방법, 그것은 것입니다 크기가 다른 경우 화면을 채우십시오.

+0

android:fillViewport="true" 추가 (http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#FILL_PARENT)은 교체 에 의해 match_parent – don

관련 문제