내 Android ListView의 높이에 어떤 문제가 있습니까?

ProfK

나는 버튼과 레이아웃을 달성하기 위해 노력하고 EditText과를 Buttton화면 상단하는에 TextView바닥에서, a는 ListView수직으로 뒤쪽의 공간을 채 웁니다. 어젯밤 나는 ListView앱의 처리를 테스트하기 위해에 절대 높이를 사용하는 것을 제외하고는 다소 정확했습니다 .

Android Studio를 닫고 지금 열어 본 이후 무슨 일이 있었는지 모르겠습니다. 마술, Git repo에 대한 것, 또는 무의식적 인 변화 일 수도 있지만, 이제는 ListView디스플레이에서 무한히 아래로 확장 되는 것 같습니다. ,이 사진에서 주황색 윤곽선으로 강조 표시 :

여기에 이미지 설명 입력

다양한 layout_height가치를 시도 50dp해봤는데 위의 사진입니다. 낮게 10dp도 차이가 없으며 상단 파란색 앵커 라인에서 마우스를 사용하여 더 작게 드래그하면 차이가 없습니다.

여기서 무엇이 잘못되었으며이 문제를 해결하기 위해 어디에서 찾아야합니까?

다음은 레이아웃에 대한 XML입니다.

<?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:layout_centerHorizontal="true"
    tools:context="com.bradykelly.heavyweights.MainActivity"
    android:weightSum="1">
<TextView
        android:layout_width="match_parent"
        android:layout_height="10dp"
        android:text="@string/adjustment_label"
        android:id="@+id/scale_text_view_label"
        android:background="@color/colorPrimaryDark"
        android:textColor="@color/textColorPrimary"
        android:layout_gravity="center_horizontal"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="20dp"
        android:textAlignment="center"
        android:gravity="center"
        android:textSize="20sp"
        android:textStyle="bold"
        android:layout_weight="0.09"
        android:height="10dp"/>
<EditText
        android:id="@+id/editText"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/text_view_border"
        android:layout_marginTop="5dp"
        android:ems="10"
        android:inputType="text"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:enabled="true"
        android:focusable="true"/>
<Button
        android:id="@+id/processButton"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="5dp"
        android:text="@string/process_file_text" />
<ListView
        android:cacheColorHint="#00000000"
        android:scrollbars="none"
        android:fadingEdge="vertical"
        android:soundEffectsEnabled="true"
        android:dividerHeight="1dp"
        android:padding="5dp"
        android:smoothScrollbar="true"
        android:layout_weight="50"
        android:layout_width="fill_parent"
        android:layout_height="50dp"
        android:drawSelectorOnTop="false"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginBottom="10dp"
        android:layout_marginTop="5dp"
        />
<TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/textView3"
        android:background="@drawable/text_view_border"
        android:layout_marginLeft="20dp"
        android:textAlignment="center"
        android:gravity="center"
        android:textSize="20sp"
        android:textStyle="bold"
        android:layout_marginRight="20dp"
        android:layout_marginBottom="-20dp"
        />
</LinearLayout>
Jay Rathod RJ

layout_weight속성을 사용하여 레이아웃을 약간 변경 했습니다. 아래 xml코드를 Layout. 아래 layout사용 하면에서 List view첨부 한 화면에 맞는 것을 보여줍니다 screen shot.

당신이 준 때문에 List view height=50또한 당신이 준 weight이 문제가 발생할 수 있도록.

You not need to define height when you are using weight property in your layout.

<?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:layout_centerHorizontal="true"
    android:orientation="vertical"
    android:weightSum="10">

    <TextView
        android:id="@+id/scale_text_view_label"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_gravity="center_horizontal"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="20dp"
        android:layout_weight="1"
        android:background="@color/colorPrimaryDark"
        android:gravity="center"
        android:text="Adjustment Label"
        android:textAlignment="center"
        android:textColor="#FFFFFF"
        android:textSize="20sp"
        android:textStyle="bold" />

    <EditText
        android:id="@+id/editText"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="5dp"
        android:ems="10"
        android:enabled="true"
        android:focusable="true"
        android:inputType="text" />

    <Button
        android:id="@+id/processButton"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="5dp"
        android:text="Process" />

    <ListView
        android:id="@+id/ListView"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_marginBottom="10dp"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="5dp"
        android:layout_weight="8"
        android:cacheColorHint="#00000000"
        android:dividerHeight="1dp"
        android:drawSelectorOnTop="false"
        android:fadingEdge="vertical"
        android:padding="5dp"
        android:scrollbars="none"
        android:smoothScrollbar="true"
        android:soundEffectsEnabled="true" />

    <TextView
        android:id="@+id/textView3"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_marginBottom="-20dp"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_weight="1"
        android:gravity="center"
        android:text="Testeing"
        android:textAlignment="center"
        android:textSize="20sp"
        android:textStyle="bold" />
</LinearLayout>

여기에 이미지 설명 입력

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Android : 내 쿼리에 어떤 문제가 있습니까?

분류에서Dev

루프 내부의이 jQuery for 루프에 어떤 문제가 있습니까?

분류에서Dev

내 웹 사이트의 스크롤바에 어떤 문제가 있습니까?

분류에서Dev

내 Haskell 유형 동의어에 어떤 문제가 있습니까?

분류에서Dev

listview의 코드에 어떤 문제가 있습니까?

분류에서Dev

내 Python 코드에 어떤 문제가 있습니까? Head First Python의 예

분류에서Dev

내 테이블 (SQLite)에 어떤 문제가 있습니까?

분류에서Dev

내 파일 이름에 어떤 문제가 있습니까?

분류에서Dev

Android : 사용자 정의 viewHolder에 어떤 문제가 있습니까?

분류에서Dev

android.opengl.Matrix.rotateM의 결과에 어떤 문제가 있습니까?

분류에서Dev

WHERE NOT EXISTS 내 UPDATE 문에 어떤 문제가 있습니까?

분류에서Dev

내 OpenSSH Include 지시문에 어떤 문제가 있습니까?

분류에서Dev

내 OpenSSH Include 지시문에 어떤 문제가 있습니까?

분류에서Dev

내 연결 문자열에 어떤 문제가 있습니까?

분류에서Dev

내 UPDATE 문에 어떤 문제가 있습니까?

분류에서Dev

내 if 문에 어떤 문제가 있습니까?

분류에서Dev

내 if else 문에 어떤 문제가 있습니까?

분류에서Dev

내 UPDATE 문에 어떤 문제가 있습니까?

분류에서Dev

Swift의 json에서 내 데이터를 구문 분석하는 데 어떤 문제가 있습니까?

분류에서Dev

내 Ubuntu Touch 앱에 어떤 문제가 있습니까?

분류에서Dev

내 SQL 명령에 어떤 문제가 있습니까?

분류에서Dev

내 쉘 스크립트에 어떤 문제가 있습니까?

분류에서Dev

내 SQL 명령에 어떤 문제가 있습니까?

분류에서Dev

내 Jade for 루프 코드에 어떤 문제가 있습니까?

분류에서Dev

내 트리거에 어떤 문제가 있습니까? Oracle SQLPLUS

분류에서Dev

내 Express Parse 설정에 어떤 문제가 있습니까?

분류에서Dev

내 squeeze () 함수에 어떤 문제가 있습니까?

분류에서Dev

내 find exclude path 명령에 어떤 문제가 있습니까?

분류에서Dev

내 Ubuntu Touch 앱에 어떤 문제가 있습니까?

Related 관련 기사

  1. 1

    Android : 내 쿼리에 어떤 문제가 있습니까?

  2. 2

    루프 내부의이 jQuery for 루프에 어떤 문제가 있습니까?

  3. 3

    내 웹 사이트의 스크롤바에 어떤 문제가 있습니까?

  4. 4

    내 Haskell 유형 동의어에 어떤 문제가 있습니까?

  5. 5

    listview의 코드에 어떤 문제가 있습니까?

  6. 6

    내 Python 코드에 어떤 문제가 있습니까? Head First Python의 예

  7. 7

    내 테이블 (SQLite)에 어떤 문제가 있습니까?

  8. 8

    내 파일 이름에 어떤 문제가 있습니까?

  9. 9

    Android : 사용자 정의 viewHolder에 어떤 문제가 있습니까?

  10. 10

    android.opengl.Matrix.rotateM의 결과에 어떤 문제가 있습니까?

  11. 11

    WHERE NOT EXISTS 내 UPDATE 문에 어떤 문제가 있습니까?

  12. 12

    내 OpenSSH Include 지시문에 어떤 문제가 있습니까?

  13. 13

    내 OpenSSH Include 지시문에 어떤 문제가 있습니까?

  14. 14

    내 연결 문자열에 어떤 문제가 있습니까?

  15. 15

    내 UPDATE 문에 어떤 문제가 있습니까?

  16. 16

    내 if 문에 어떤 문제가 있습니까?

  17. 17

    내 if else 문에 어떤 문제가 있습니까?

  18. 18

    내 UPDATE 문에 어떤 문제가 있습니까?

  19. 19

    Swift의 json에서 내 데이터를 구문 분석하는 데 어떤 문제가 있습니까?

  20. 20

    내 Ubuntu Touch 앱에 어떤 문제가 있습니까?

  21. 21

    내 SQL 명령에 어떤 문제가 있습니까?

  22. 22

    내 쉘 스크립트에 어떤 문제가 있습니까?

  23. 23

    내 SQL 명령에 어떤 문제가 있습니까?

  24. 24

    내 Jade for 루프 코드에 어떤 문제가 있습니까?

  25. 25

    내 트리거에 어떤 문제가 있습니까? Oracle SQLPLUS

  26. 26

    내 Express Parse 설정에 어떤 문제가 있습니까?

  27. 27

    내 squeeze () 함수에 어떤 문제가 있습니까?

  28. 28

    내 find exclude path 명령에 어떤 문제가 있습니까?

  29. 29

    내 Ubuntu Touch 앱에 어떤 문제가 있습니까?

뜨겁다태그

보관