안녕하세요 안드로이드 공부중인 초보자입니다.
최근에는 리스트뷰를 잘 쓰지않는다고하지만 리사이클러뷰 공부전에 리스트뷰부터 공부하는것이
좋을것같다고해서 이것먼저 하고있습니다..!
팔레트의 디자인탭을 보면 리스트 뷰를 추가를하면 두번째 사진처럼 나와야하는것같은데..저는 첫번째 사진처럼 나옵니다.그..아이템이 한개로 보인다는 말이죠...
코드 작성을하는데 큰문제는 없다!하면 상관은 없겠지만..다르게 나오니 뭐가 문제인지 이해가 잘가질 않습니다.
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="15dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp">
<LinearLayout
android:id="@+id/list_linearlayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentTop="true">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="한줄평"
android:textColor="@color/black"
android:textSize="22dp"
android:textStyle="bold" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<!-- 버튼 테두리 없애기 = #00ff0000 -->
<!-- drawableLeft : 버튼 내부 텍스트 왼쪽에 이미지위치 -->
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="작성하기"
android:drawableLeft="@drawable/ic_review_selected"
android:textSize="22dp"
android:textStyle="bold"
android:background="#00ff0000"/>
</LinearLayout>
<ListView
android:id="@+id/listview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/list_linearlayout">
</ListView>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_below="@id/listview"
android:text="모두 보기"
android:textSize="22dp"
android:textColor="@color/purple"
android:background="@drawable/see_all_button">
</Button>
</RelativeLayout>
코드가 해당부분의 코드가 이것인데..제일아래 버튼은 제가 방금 추가한것입니다.
아이템이 디자인탭에서 하나만 보이니 뭔가 잘못됐나 싶은데..
이건 일부분이고 위아래로 다른 코드가 좀 더 있습니다..해당부분만 가지고 왔어요.
프로젝트를 하나 만들어서 윗부분 코드를 복사해보니 잘나오기는 하던데..
아래 다른코드때문에 막힘?그런 것인지ㅜㅜ