• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    미해결

게시판 만들기에서 게시글 ListView만들기 에서 발생한 문제 질문드립니다.

22.05.06 21:55 작성 조회수 467

0

강의를 보며 개발자님과 똑같이 하지 않고 저에게 필요한 부분들을 제 스타일대로 바꾸면서 듣고 있습니다. 잘 되다 이번에 문제가 생겼습니다. 현재 레이아웃이 겹칩니다.. 어느 부분의 코드를 보여드리야할까요.. 추가적으로 어떤 걸 말씀드려야하는지 알려주시면 더 자세하게 질문하겠습니다. 도와주세요

답변 3

·

답변을 작성해보세요.

0

혹시 listview에 위에 marginTop을 줘보시겠어요?

 

<ListView
android:id="@+id/boardListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="50dp"
android:layout_marginBottom="70dp" />
wngh4191님의 프로필

wngh4191

질문자

2022.05.10

감사합니다 덕분에 해결되었습니다.

0

wngh4191님의 프로필

wngh4191

질문자

2022.05.07

<?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="100dp"
android:orientation="vertical">

<TextView
android:id="@+id/titleArea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:text="title"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold" />

<TextView
android:id="@+id/contentArea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:text="content"
android:textColor="@color/black"
android:textSize="15sp" />

<TextView
android:id="@+id/timeArea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:text="time"
android:textColor="#999999"
android:textSize="10sp" />


</LinearLayout>

// 위 코드는 board_list_item.xml 코드 입니다 (title, content, time이 적혀있는)
// 아래 코드는 택시 그림과 오른쪽에 메뉴를 선택할 수 있는 코드입니다.(board_list_item.xml과 겹치는)

<?xml version="1.0" encoding="utf-8"?>

<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">


<!-- TODO: Update blank fragment layout -->
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<ListView
android:id="@+id/boardListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="70dp" />

<ImageView
android:id="@+id/writeBtn"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="80dp"
android:src="@drawable/write"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="5dp"
app:layout_constraintBottom_toTopOf="@+id/linearLayout">


<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/mainColor" />

</LinearLayout>

<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@color/white"
app:layout_constraintBottom_toBottomOf="parent">

<ImageView
android:id="@+id/homeTap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/home" />

<ImageView
android:id="@+id/talkTap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/talk" />

<ImageView
android:id="@+id/writeTap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/note" />

</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

0

xml 파일을 공유해주시면 문제를 찾을 수 있을 것 같아요~

wngh4191님의 프로필

wngh4191

질문자

2022.05.07

<?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="100dp"
android:orientation="vertical">

<TextView
android:id="@+id/titleArea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:text="title"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold" />

<TextView
android:id="@+id/contentArea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:text="content"
android:textColor="@color/black"
android:textSize="15sp" />

<TextView
android:id="@+id/timeArea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:text="time"
android:textColor="#999999"
android:textSize="10sp" />


</LinearLayout>

// 위 코드는 board_list_item.xml 코드 입니다 (title, content, time이 적혀있는)
// 아래 코드는 택시 그림과 오른쪽에 메뉴를 선택할 수 있는 코드입니다.(board_list_item.xml과 겹치는)

<?xml version="1.0" encoding="utf-8"?>

<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">


<!-- TODO: Update blank fragment layout -->
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<ListView
android:id="@+id/boardListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="70dp" />

<ImageView
android:id="@+id/writeBtn"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="80dp"
android:src="@drawable/write"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="5dp"
app:layout_constraintBottom_toTopOf="@+id/linearLayout">


<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/mainColor" />

</LinearLayout>

<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@color/white"
app:layout_constraintBottom_toBottomOf="parent">

<ImageView
android:id="@+id/homeTap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/home" />

<ImageView
android:id="@+id/talkTap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/talk" />

<ImageView
android:id="@+id/writeTap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/note" />

</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>