01/10/2018, 14:21

Lỗi giao diện bị co lại 1 điểm lập trình Android

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.

com0t viết 16:31 ngày 01/10/2018

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

cuti nguyen viết 16:28 ngày 01/10/2018

Bạn phải nói rõ bạn sử dụng layout gì đã chứ. Relative, Frame,…

mai viết 16:31 ngày 01/10/2018

Đâ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.

DanhDC viết 16:24 ngày 01/10/2018

nếu dùng ConstraintLayout k quen thì bạn chuyển sang dùng LinearLayout hay RelativeLayout đi cho dễ

Bài liên quan
0