• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    미해결

이미지 업로드

23.07.15 20:12 작성 조회수 203

0

스크린샷 2023-07-15 오후 8.05.22.png

게시글 작성 xml 을 동일하게 따라했는데도 이미지를 업로드 하면 이미지와 content 사이에 마진이 생깁니다.

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

<layout>

    <LinearLayout
        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"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".BoardWriteActivity"
        android:orientation="vertical">

        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="60dp">

                    <TextView
                        android:text="글쓰기 페이지"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:textColor="@color/black"
                        android:gravity="center"/>

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="0.5dp"
                    android:background="#000000"/>

                <EditText
                    android:id="@+id/titleView"
                    android:layout_margin="20dp"
                    android:layout_width="match_parent"
                    android:background="@android:color/transparent"
                    android:hint="제목을 입력해주세요"
                    android:layout_height="60dp"/>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="0.5dp"
                    android:layout_marginLeft="20dp"
                    android:layout_marginRight="20dp"
                    android:background="#000000"/>

                <EditText
                    android:id="@+id/contentView"
                    android:layout_margin="20dp"
                    android:layout_width="match_parent"
                    android:hint="내용을 입력해주세요"
                    android:background="@android:color/transparent"
                    android:layout_height="60dp"/>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="0.5dp"
                    android:layout_marginLeft="20dp"
                    android:layout_marginRight="20dp"
                    android:background="#000000"/>

                <ImageView
                    android:id="@+id/contentImage"
                    android:src="@drawable/plusbtn"
                    android:layout_marginTop="20dp"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"/>

                <Button
                    android:id="@+id/textUploadBtn"
                    android:text="입력"
                    android:layout_width="match_parent"
                    android:background="@drawable/custom_edittext"
                    android:layout_marginTop="50dp"
                    android:layout_marginLeft="20dp"
                    android:layout_marginRight="20dp"
                    android:layout_height="wrap_content"/>

            </LinearLayout>

        </ScrollView>

    </LinearLayout>

</layout>

답변 1

답변을 작성해보세요.

0

안녕하세요.

말씀해주신 정보로는 파악이 조금 어려운데요.

  1. 강의 어느 부분을 보고 있으신건지

  2. 원래 어떻게 나오기를 바라시는건지

  3. 현재 어떻게 나오고있는지

를 설명해주시면 도움드릴 수 있을 것 같습니다.

hi님의 프로필

hi

질문자

2023.07.15

강의 이미지 업로드 부분을 보고 있습니다. 강의에서는 이미지가 글쓰는 부분 바로 아래에 뜨는데 제가 하면 margin이 사진 위 아래로 크게 제가 올린 사진처럼 생깁니다.

image

보내주신 코드가 글쓰기 페이지 맞나요?

제가 이미지를 임시로 넣어봤는데 동일하게 보이지 않는가요?