Câu hỏi được gắn thẻ «android-layout»

Bố cục xác định cấu trúc trực quan cho giao diện người dùng, chẳng hạn như giao diện người dùng cho một hoạt động, đoạn hoặc tiện ích ứng dụng.


13
Android vẽ một đường ngang giữa các chế độ xem
Tôi có Bố cục của mình như dưới đây: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:id="@+id/textView1" style="@style/behindMenuItemLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:text="Twitter Feeds" android:textStyle="bold" /> <ListView android:id="@+id/list" android:layout_width="350dp" android:layout_height="50dp" /> <TextView android:id="@+id/textView1" style="@style/behindMenuItemLabel1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="1dp" android:text="FaceBook Feeds" /> <ListView android:id="@+id/list1" android:layout_width="350dp" android:layout_height="50dp" /> </LinearLayout> Yêu cầu …

7
Android ConstraintLayout - Đặt một chế độ xem lên trên một chế độ xem khác
Tôi đang cố gắng thêm một ProgressBarvào đầu của a Button(cả hai đều nằm trong a ConstraintLayout). <Button android:id="@+id/sign_in_button" android:layout_width="280dp" android:layout_height="75dp" android:layout_marginBottom="75dp" android:layout_marginTop="50dp" android:text="@string/sign_in" android:textColor="@color/white" android:textSize="22sp" android:textStyle="bold" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toBottomOf="@+id/passwordEditText" app:layout_constraintVertical_bias="0.0"/> <ProgressBar android:id="@+id/progressBar" style="?android:attr/progressBarStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" app:layout_constraintTop_toTopOf="@+id/sign_in_button" android:layout_marginTop="8dp" app:layout_constraintBottom_toBottomOf="@+id/sign_in_button" android:layout_marginBottom="8dp" app:layout_constraintVertical_bias="0.5" android:layout_marginLeft="8dp" app:layout_constraintLeft_toLeftOf="@+id/sign_in_button" android:layout_marginRight="8dp" app:layout_constraintRight_toRightOf="@+id/sign_in_button"/> Nhưng ngay cả sau …




8
Làm cách nào để sửa đổi màu gợn sóng khi sử dụng? Attr / selectableItemBackground làm nền?
Tôi đã thấy một số câu hỏi SO và họ đã đưa ra một số phương pháp khả thi để đạt được điều tôi muốn. Ví dụ: Sử dụng colorControlHighlightthuộc tính trong styles.xml. Đây là styles-v21.xml của tôi: <style name="SelectableItemBackground"> <item name="android:colorControlHighlight">#5677FC</item> <item name="android:background">?attr/selectableItemBackground</item> </style> Và tiện ích của tôi: …

1
Sử dụng không gian tên ứng dụng theo phong cách
Tôi sẽ đưa ra một ví dụ để chứng minh điểm quan trọng hơn. Hãy tưởng tượng ứng dụng của tôi có một số FloatingActionButtons. Do đó, tôi muốn tạo một kiểu và sử dụng lại nó. Vì vậy, tôi làm như sau: <style name="FabStyle” parent ="Widget.Design.FloatingActionButton"> <item name="android:layout_width">wrap_content</item> <item …


13
Appcompatv7 - v21 Ngăn điều hướng không hiển thị biểu tượng bánh hamburger
Tôi đang triển khai ngăn điều hướng kiểu kẹo mút với thư viện hỗ trợ appcompat mới nhất nhưng vấn đề là biểu tượng bánh hamburger không bao giờ được hiển thị. Chỉ có biểu tượng quay lại được hiển thị. Đây là mã hoạt động của tôi import android.os.Bundle; …



11
java.lang.IllegalStateException: Con được chỉ định đã có cha
Tôi đang sử dụng các mảnh vỡ, khi tôi khởi tạo một đoạn ngay lần đầu tiên nó. nhưng lần thứ hai tôi có ngoại lệ này. Tôi không thể tìm thấy dòng mà tôi gặp lỗi? 04-04 08:51:54.320: E/AndroidRuntime(29713): FATAL EXCEPTION: main 04-04 08:51:54.320: E/AndroidRuntime(29713): java.lang.IllegalStateException: The specified child …

10
Cuộn trang khi bàn phím mềm bật lên
Tôi có một <ScrollView>bố cục: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/my_scrollview" android:layout_width="fill_parent" android:layout_height="wrap_content" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <EditText android:id="@+id/input_one" android:layout_width="300dp" android:layout_height="wrap_content" android:layout_gravity="center" android:inputType="number" > <EditText android:id="@+id/input_two" android:layout_width="300dp" android:layout_height="wrap_content" android:layout_gravity="center" android:inputType="number" > <EditText android:id="@+id/input_three" android:layout_width="300dp" android:layout_height="wrap_content" android:layout_gravity="center" android:inputType="number" > <Button android:id="@+id/ok_btn" android:layout_width="200dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="20dp" android:text="@string/ok_str" /> </LinearLayout> </ScrollView> …

10
Không thể làm cho DialogFragment tùy chỉnh trong suốt trên Fragment
Tôi cần tạo một hộp thoại trên một phân đoạn (chiếm toàn bộ màn hình). Hộp thoại cần phải là hộp thoại nổi sẽ được định vị trên phân đoạn với phân đoạn được làm tối bên ngoài mảnh .. Đối với Hộp thoại tùy chỉnh, tôi có một LineLayout …

Khi sử dụng trang web của chúng tôi, bạn xác nhận rằng bạn đã đọc và hiểu Chính sách cookieChính sách bảo mật của chúng tôi.
Licensed under cc by-sa 3.0 with attribution required.