Chào mọi người, mình mới học lập trình android,đến phần giao diện mình gặp lỗi tất cả các textview và button bị co lại 1 điểm như trên hình, nhờ bạn bè tứ phương chỉ cách mình gỡ lỗi này với.
Cảm ơn mọi người.
Lỗi giao diện bị co lại 1 điểm lập trình Android
Mình nghĩ chắc do bạn chưa set vị trí giữ các view. Bạn nên cho mọi người xem code xml
1 Like
Bạn phải nói rõ bạn sử dụng layout gì đã chứ. Relative, Frame,…
Đây là code trong phần giao diện màn hình chính
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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="com.example.maiphu.myapplication.MainActivity">
<Button
android:id="@+id/btn_nhay"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:text="Nhảy"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="162dp"
tools:layout_editor_absoluteY="295dp" />
<EditText
android:id="@+id/id_text"
android:layout_width="261dp"
android:layout_height="55dp"
android:ems="10"
android:inputType="textPersonName"
android:text="Name"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="62dp"
tools:layout_editor_absoluteY="86dp" />
</android.support.constraint.ConstraintLayout>
mọi người giúp mình với.
nếu dùng ConstraintLayout k quen thì bạn chuyển sang dùng LinearLayout hay RelativeLayout đi cho dễ