안드로이드 스튜디오로 어플 실행시켰을 때 만든대로 화면이 안 뜬다면..?
조회수 1235회
-
(•́ ✖ •̀)
알 수 없는 사용자
1 답변
-
레이아웃을 만드실 때 뷰를 드래그엔드드롭해서 만드시지 마시고 직접 레이아웃 (리니어 레이아웃, 프레임레이아웃, 릴레이티브레이아웃 등)들의 특성을 공부해서 코딩으로 넣으시길 바랍니다.
첨부하신 사진의 레아웃으로 대충 만들어보았습니다
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:padding="40dp"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content"/> <EditText android:layout_width="match_parent" android:layout_height="wrap_content"/> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="15dp" android:orientation="horizontal" android:gravity="center"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="20dp" android:text="Button1"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:text="Button1"/> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="15dp" android:orientation="horizontal" android:gravity="center"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="20dp" android:text="Button1"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:text="Button1"/> </LinearLayout> <TextView android:layout_margin="50dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:text="sample"/></LinearLayout>
-
(•́ ✖ •̀)
알 수 없는 사용자
- 헉.. 진짜 진짜 감사합니다 ㅠㅠ 많은 도움이 되었습니다..ㅠㅠ 혹시 자바 공부할 때 추천하는 책 같은 거 있으시면 말씀해주실 수 있나요?? 제가 독학이라 좀 막막하네요..ㅠㅠㅠㅠ 알 수 없는 사용자 2017.9.11 22:00
-
댓글 입력