对话框打开时布局混乱

2023-12-29

我面临着一个非常奇怪的错误,其中一个布局的父级是 ConstraintLayout。当对话框打开时,后面的布局会自动开始收缩和移动。请参阅随附的 gif 来了解有关该错误的信息。请检查我的代码,看看我是否做错了什么。

这是我的布局。

<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"
    android:background="@color/picker_bg"
    android:padding="@dimen/_8dp">

    <!-- Pick details layout starts -->

    <android.support.v7.widget.CardView
        android:id="@+id/load_details_card"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:cardCornerRadius="@dimen/_1dp"
        app:cardElevation="@dimen/_2dp"
        app:layout_constraintEnd_toStartOf="@+id/load_status_card"
        app:layout_constraintStart_toStartOf="parent">

        <android.support.constraint.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="@dimen/_8dp"
            android:paddingEnd="@dimen/_12dp"
            android:paddingStart="@dimen/_12dp"
            android:paddingTop="@dimen/_8dp">

            <TextView
                android:id="@+id/load_id"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:text="@string/load_id"
                android:textSize="@dimen/_16sp"
                app:layout_constraintEnd_toStartOf="@+id/stops"
                app:layout_constraintHorizontal_chainStyle="packed"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintStart_toStartOf="parent" />

            <TextView
                android:id="@+id/load_id_value"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_6dp"
                android:gravity="center_horizontal"
                android:text="900"
                android:textSize="@dimen/_16sp"
                app:layout_constraintEnd_toEndOf="@+id/load_id"
                app:layout_constraintStart_toStartOf="@+id/load_id"
                app:layout_constraintTop_toBottomOf="@+id/load_id" />

            <TextView
                android:id="@+id/stops"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/_12dp"
                android:gravity="center_horizontal"
                android:text="@string/stops"
                android:textSize="@dimen/_16sp"
                app:layout_constraintEnd_toStartOf="@+id/truck"
                app:layout_constraintStart_toEndOf="@+id/load_id" />

            <TextView
                android:id="@+id/stops_value"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_6dp"
                android:gravity="center_horizontal"
                android:text="3"
                android:textSize="@dimen/_16sp"
                app:layout_constraintEnd_toEndOf="@+id/stops"
                app:layout_constraintStart_toStartOf="@+id/stops"
                app:layout_constraintTop_toBottomOf="@+id/stops" />

            <TextView
                android:id="@+id/truck"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/_12dp"
                android:gravity="center_horizontal"
                android:text="@string/truck"
                android:textSize="@dimen/_16sp"
                app:layout_constraintEnd_toStartOf="@+id/trailer"
                app:layout_constraintStart_toEndOf="@+id/stops" />

            <TextView
                android:id="@+id/truck_value"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_6dp"
                android:gravity="center_horizontal"
                android:text="100"
                android:textSize="@dimen/_16sp"
                app:layout_constraintEnd_toEndOf="@+id/truck"
                app:layout_constraintStart_toStartOf="@+id/truck"
                app:layout_constraintTop_toBottomOf="@+id/truck" />

            <TextView
                android:id="@+id/trailer"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/_12dp"
                android:gravity="center_horizontal"
                android:text="@string/trailer"
                android:textSize="@dimen/_16sp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toEndOf="@+id/truck" />

            <TextView
                android:id="@+id/trailer_value"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_6dp"
                android:gravity="center_horizontal"
                android:text="300"
                android:textSize="@dimen/_16sp"
                app:layout_constraintEnd_toEndOf="@+id/trailer"
                app:layout_constraintStart_toStartOf="@+id/trailer"
                app:layout_constraintTop_toBottomOf="@+id/trailer" />

        </android.support.constraint.ConstraintLayout>
    </android.support.v7.widget.CardView>

    <!-- Pick details layout end -->

    <!-- Pick status layout starts -->

    <android.support.v7.widget.CardView
        android:id="@+id/load_status_card"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/_8dp"
        app:cardCornerRadius="@dimen/_1dp"
        app:cardElevation="@dimen/_2dp"
        app:layout_constraintEnd_toStartOf="@+id/bt_move_items_to_stage"
        app:layout_constraintStart_toEndOf="@+id/load_details_card">

        <android.support.constraint.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="@dimen/_8dp"
            android:paddingEnd="@dimen/_12dp"
            android:paddingStart="@dimen/_12dp"
            android:paddingTop="@dimen/_8dp">

            <TextView
                android:id="@+id/status"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:text="Status"
                android:textSize="@dimen/_16sp"
                app:layout_constraintEnd_toStartOf="@+id/start_time"
                app:layout_constraintHorizontal_chainStyle="packed"
                app:layout_constraintStart_toStartOf="parent" />

            <TextView
                android:id="@+id/status_value"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_6dp"
                android:gravity="center_horizontal"
                android:text="Start"
                android:textSize="@dimen/_16sp"
                app:layout_constraintEnd_toEndOf="@+id/status"
                app:layout_constraintStart_toStartOf="@+id/status"
                app:layout_constraintTop_toBottomOf="@+id/status" />

            <TextView
                android:id="@+id/start_time"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/_12dp"
                android:gravity="center_horizontal"
                android:text="Start Time"
                android:textSize="@dimen/_16sp"
                app:layout_constraintEnd_toStartOf="@+id/break_time"
                app:layout_constraintStart_toEndOf="@+id/status" />

            <TextView
                android:id="@+id/start_time_value"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_6dp"
                android:gravity="center_horizontal"
                android:text="472423"
                android:textSize="@dimen/_16sp"
                app:layout_constraintEnd_toEndOf="@+id/start_time"
                app:layout_constraintStart_toStartOf="@+id/start_time"
                app:layout_constraintTop_toBottomOf="@+id/start_time"
                tools:layout_editor_absoluteX="355dp" />

            <TextView
                android:id="@+id/break_time"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/_12dp"
                android:gravity="center_horizontal"
                android:text="Break Time"
                android:textSize="@dimen/_16sp"
                app:layout_constraintEnd_toStartOf="@+id/total_breaks"
                app:layout_constraintStart_toEndOf="@+id/start_time" />

            <TextView
                android:id="@+id/break_time_value"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_6dp"
                android:gravity="center_horizontal"
                android:text="00:00:00"
                android:textSize="@dimen/_16sp"
                app:layout_constraintEnd_toEndOf="@+id/break_time"
                app:layout_constraintStart_toStartOf="@+id/break_time"
                app:layout_constraintTop_toBottomOf="@+id/break_time"
                tools:layout_editor_absoluteX="1154dp" />

            <TextView
                android:id="@+id/total_breaks"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/_12dp"
                android:gravity="center_horizontal"
                android:text="Total Breaks"
                android:textSize="@dimen/_16sp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toEndOf="@+id/break_time" />

            <TextView
                android:id="@+id/total_breaks_value"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_6dp"
                android:gravity="center_horizontal"
                android:text="0"
                android:textSize="@dimen/_16sp"
                app:layout_constraintEnd_toEndOf="@+id/total_breaks"
                app:layout_constraintStart_toStartOf="@+id/total_breaks"
                app:layout_constraintTop_toBottomOf="@+id/total_breaks" />

        </android.support.constraint.ConstraintLayout>

    </android.support.v7.widget.CardView>

    <!-- Pick status layout end -->

    <!-- Button move items to stage -->

    <Button
        android:id="@+id/bt_unload_items"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginStart="@dimen/_8dp"
        android:backgroundTint="@color/colorPrimary"
        android:drawableStart="@drawable/ic_archive_black_24dp"
        android:drawablePadding="@dimen/_4dp"
        android:drawableTint="@color/white"
        android:tag="picking"
        android:text="@string/unload_items"
        android:textColor="@color/white"
        android:textSize="@dimen/_13sp"
        app:layout_constraintBottom_toBottomOf="@+id/load_status_card"
        app:layout_constraintEnd_toStartOf="@+id/bt_finish_loading"
        app:layout_constraintHorizontal_chainStyle="spread"
        app:layout_constraintHorizontal_weight="1"
        app:layout_constraintStart_toEndOf="@+id/load_status_card"
        app:layout_constraintTop_toTopOf="@+id/load_status_card"
        app:layout_constraintVertical_bias="1.0" />

    <!-- Button finish picking -->

    <Button
        android:id="@+id/bt_finish_loading"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:drawablePadding="@dimen/_4dp"
        android:layout_marginStart="@dimen/_8dp"
        android:backgroundTint="@color/colorAccent"
        android:drawableStart="@drawable/ic_done_black_24dp"
        android:drawableTint="@color/white"
        android:text="Finish Loading"
        android:textColor="@color/white"

        android:textSize="@dimen/_13sp"
        app:layout_constraintBottom_toBottomOf="@+id/bt_unload_items"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_weight="1"
        app:layout_constraintStart_toEndOf="@+id/bt_unload_items"
        app:layout_constraintTop_toTopOf="@+id/bt_unload_items"
        app:layout_constraintVertical_bias="0.0" />

    <!-- Button instructions -->

    <Button
        android:id="@+id/bt_instructions"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:minHeight="@dimen/_53dp"
        android:drawablePadding="@dimen/_4dp"
        android:layout_marginLeft="@dimen/_2dp"
        android:layout_marginTop="@dimen/_8dp"
        android:backgroundTint="@color/colorPrimary"
        android:drawableStart="@drawable/ic_info_outline_black_24dp"
        android:drawableTint="@color/white"
        android:text="Instructions"
        android:textColor="@color/white"
        android:textSize="@dimen/_13sp"
        app:layout_constraintEnd_toStartOf="@+id/layout_progress"
        app:layout_constraintHorizontal_weight="1"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/load_details_card" />

    <!-- Picking progress layout-->

    <include
        android:id="@+id/layout_progress"
        layout="@layout/layout_progress_horizontal_percentage"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginStart="@dimen/_8dp"
        app:layout_constraintBottom_toBottomOf="@+id/bt_instructions"
        app:layout_constraintEnd_toStartOf="@+id/bt_suspend"
        app:layout_constraintHorizontal_weight="3.4"
        app:layout_constraintStart_toEndOf="@+id/bt_instructions"
        app:layout_constraintTop_toTopOf="@+id/bt_instructions" />

    <!-- Button suspend -->

    <Button
        android:id="@+id/bt_suspend"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:drawablePadding="@dimen/_4dp"
        android:layout_marginStart="@dimen/_8dp"
        android:backgroundTint="@color/colorPrimary"
        android:drawableStart="@drawable/ic_stop_black_24dp"
        android:drawableTint="@color/white"
        android:text="Suspend"
        android:textColor="@color/white"
        android:textSize="@dimen/_13sp"
        app:layout_constraintBottom_toBottomOf="@+id/layout_progress"
        app:layout_constraintEnd_toStartOf="@+id/bt_pause"
        app:layout_constraintHorizontal_weight="1"
        app:layout_constraintStart_toEndOf="@+id/layout_progress"
        app:layout_constraintTop_toTopOf="@+id/layout_progress"
        app:layout_constraintVertical_bias="0.0"
        tools:layout_editor_absoluteX="654dp" />

    <!-- Button pause -->

    <Button
        android:id="@+id/bt_pause"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginStart="@dimen/_8dp"
        android:drawablePadding="@dimen/_4dp"
        android:backgroundTint="@color/colorPrimary"
        android:drawableStart="@drawable/ic_pause_black_24dp"
        android:drawableTint="@color/white"
        android:padding="@dimen/_8dp"
        android:text="Pause"
        android:textColor="@color/white"
        android:textSize="@dimen/_13sp"
        app:layout_constraintBottom_toBottomOf="@+id/bt_suspend"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_weight="1"
        app:layout_constraintStart_toEndOf="@+id/bt_suspend"
        app:layout_constraintTop_toTopOf="@+id/bt_suspend"
        tools:layout_editor_absoluteX="1089dp" />

    <!-- Building selection layout starts -->

    <!-- Building selection layout ends -->

    <!-- Fragment Container -->
    <!-- app:layout_constraintTop_toTopOf="@+id/layout_building" -->
    <ScrollView
        android:id="@+id/scrollview_nested_fragment_container"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginStart="12dp"
        android:layout_marginTop="12dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_weight="5"
        app:layout_constraintStart_toEndOf="@+id/layout_stop"
        app:layout_constraintTop_toBottomOf="@+id/bt_instructions">

        <FrameLayout
            android:id="@+id/nested_fragment_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </ScrollView>

    <android.support.v7.widget.CardView
        android:id="@+id/layout_stop"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/_8dp"
        app:layout_constraintEnd_toStartOf="@+id/scrollview_nested_fragment_container"
        app:layout_constraintHorizontal_weight="1"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/bt_instructions"
        tools:layout_editor_absoluteX="16dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <LinearLayout
                android:id="@+id/all_stops"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/selector_building_bg"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:padding="@dimen/_4dp"
                android:tag="0">

                <TextView
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="All"
                    android:textColor="@color/selector_building_text" />


                <TextView
                    android:id="@+id/all_stops_pick_count"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/_15dp"
                    android:text="10"
                    android:textColor="@color/selector_building_text" />

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/_15dp"
                    android:src="@drawable/ic_keyboard_arrow_right_black_24dp"
                    android:tint="@color/selector_building_arrow" />

            </LinearLayout>

            <LinearLayout
                android:id="@+id/stop_1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/selector_building_bg"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:padding="@dimen/_4dp"
                android:tag="1">

                <TextView
                    android:id="@+id/textView8"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="Stop 1"
                    android:textColor="@color/selector_building_text" />


                <TextView
                    android:id="@+id/stop_1_pick_count"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/_15dp"
                    android:text="3"
                    android:textColor="@color/selector_building_text" />

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/_15dp"
                    android:src="@drawable/ic_keyboard_arrow_right_black_24dp"
                    android:tint="@color/selector_building_arrow" />

            </LinearLayout>

            <LinearLayout
                android:id="@+id/stop_2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/selector_building_bg"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:padding="@dimen/_4dp"
                android:tag="2">

                <TextView
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="Stop 2"
                    android:textColor="@color/selector_building_text" />


                <TextView
                    android:id="@+id/stop_2_pick_count"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/_15dp"
                    android:text="2"
                    android:textColor="@color/selector_building_text" />

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/_15dp"
                    android:src="@drawable/ic_keyboard_arrow_right_black_24dp"
                    android:tint="@color/selector_building_arrow" />

            </LinearLayout>

            <LinearLayout
                android:id="@+id/stop_3"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/selector_building_bg"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:padding="@dimen/_4dp"
                android:tag="3">

                <TextView
                    android:id="@+id/textView6"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="Stop 3"
                    android:textColor="@color/selector_building_text" />


                <TextView
                    android:id="@+id/stop_3_pick_count"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/_15dp"
                    android:text="5"
                    android:textColor="@color/selector_building_text" />

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/_15dp"
                    android:src="@drawable/ic_keyboard_arrow_right_black_24dp"
                    android:tint="@color/selector_building_arrow" />

            </LinearLayout>

        </LinearLayout>


    </android.support.v7.widget.CardView>

    <!-- Table layout -->

    <!-- <android.support.v7.widget.CardView
         android:id="@+id/table"
         android:layout_width="0dp"
         android:layout_height="0dp"
         android:layout_marginStart="12dp"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintHorizontal_weight="5"
         app:layout_constraintStart_toEndOf="@+id/layout_building"
         app:layout_constraintTop_toBottomOf="@+id/bt_instructions"
         app:layout_constraintTop_toTopOf="@+id/layout_building">

         <include layout="@layout/layout_picking_table" />

     </android.support.v7.widget.CardView>-->

</android.support.constraint.ConstraintLayout>

Here is the gif enter image description here


None

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

对话框打开时布局混乱 的相关文章

  • 在 android volley 中使用 StringRequest 时如何处理响应中的对象数组

    我有安卓应用程序 在该应用程序中 我在服务器上发布一些字符串数据并获得一些响应 问题是 我收到 jsonstring 中的响应 但我希望此数据位于 json 数组中 尽管当我使用 JsonArrayRequest 时 它不允许在参数中使用
  • 销毁Android应用程序

    我开发了一个运行良好的应用程序 我使用了一些静态变量并设置了应用程序级别变量 我的问题是 即使在每个活动上设置 finish 之后 应用程序仍显示在运行模式下 关闭应用程序后 当我在一段时间后启动应用程序时 它将设置最后的更改 我怎样才能销
  • 在旧版本的 API 上更改 ContentObserver Onchange 上的 uri [重复]

    这个问题在这里已经有答案了 可能的重复 如何获取内容观察器中插入行的 URI https stackoverflow com questions 8432800 how to get uri of inserted row in my co
  • Android NumberPicker 带字符串

    I have customised the NumberPicker to show text The output is this 当我按 确定 时 我想将 e x 鼠标添加到我的列表 文章 中 我得到的是索引值 int 它由 array
  • Firebase 查询 Or'ing whereEqualTo 以获得可能值的列表

    我见过之前针对早期版本的 Firebase 提出过这个问题 https stackoverflow com questions 26700924 query based on multiple where clauses in fireba
  • 更改 Android Spinner 布局/设计

    我正在尝试修改设计Spinner http developer android com intl de reference android widget Spinner html小部件 我可以更改背景 但找不到更改右侧箭头图标的方法 有办法
  • 指标元素之间的空间

    如何增加 减少指标元素之间的空间ViewPagerIndicator 我用过CirclePageIndicator 我能够通过以下步骤在两个指标之间留出更多空间 打开源代码CirclePageIndicator并找到变量mRadius 在第
  • 启动时的 Android pin 活动

    我有一个应用程序 它将自身注册为默认启动器 并在启动时自动固定自身 安装应用程序时这一切都正常 它会自行固定 并且只有后退按钮可见 问题是 当设备首次启动时 它无法正确固定 我多次看到一系列 屏幕固定 和 屏幕取消固定 的 toast 主页
  • 如何在phonegap上使用GCM处理android中的多个推送通知

    当推送通知到达时 如果用户无法查看该通知 他收到另一条通知 之前的通知正在更新为新的 但它不应该更新为最新的 我们需要单独显示每个通知 这可以使用 GCM 吗 我已经使用Phonegap来开发应用程序 PushPlugin 支持在有效负载中
  • FragmentTransaction 动画滑入顶部

    我试图使用 FragmentTransaction setCustomAnimations 实现以下效果 片段A正在显示 将片段 A 替换为片段 B 片段 A 在替换过程中应保持可见 片段 B 应从右侧滑入 片段 B 应滑入片段 A 的顶部
  • Android:多图像密度支持 - 缩放高度宽度和 dpi?

    我有一个 Android 应用程序 我正在尝试添加对不同密度 屏幕尺寸等的支持 我已经在具有 HVGA 支持的模拟器上开发了该应用程序 并使用了我们 iphone 应用程序中的所有图标 自从分辨率以来 结果很好分辨率为 320x480 现在
  • Android Mockito.verify 说参数不同!打印相同内容

    情况 我有一个界面Tracker其中有这个方法 fun trackEvent event String args Bundle null 我想验证是否使用特定的调用此方法event 被测试的内部对象调用此方法Bundle目的 所有事件都指定
  • 如何查看Android Asset资源?

    我想检查 assets 文件夹中是否存在文件 我怎样才能做到呢 请帮忙 我向我的应用程序类之一添加了一个辅助方法 我假设 应用程序运行时 资产列表不会更改 the List
  • 使用 Asp.Net 的 GCM 推送通知

    正如您可能已经看到的 Google 正在迁移其推送通知系统 http developer android com guide google gcm c2dm html http developer android com guide goo
  • Android 设备 ID(不是 IMEI)

    我使用命令 adb devices 列出连接的设备 在我的电脑上我得到 附加设备列表 HT9CTP820988 器件 我的问题是 如何以编程方式获取此 id HT9CTP820988 你所看到的adb devices命令是序列号 序列号 创
  • Android 上的 Jetty 上的 Jersey 抛出 ContainerException:“不存在 WebApplication 提供程序”

    我正在尝试在 Android 上的 Jetty 上运行 Jersey 我创建了一个 Android 它使用 Jersey Servlet 实例化 Jetty 服务器 无论如何 当我启动 Jetty 并访问 REST 资源时 在我的例子中 h
  • 在 Android 版 Glide 中离线时加载已获取的图像

    我正在使用 Glide 版本 4 8 0 为了加载图像我这样做 GlideApp with HomePageFragment this load remoteURL diskCacheStrategy DiskCacheStrategy A
  • 无法读取解析推送通知包数据

    我尝试使用 Parse 推送通知服务发送自定义数据 但从 Bundle 中提取时总是返回 null 值 自定义广播接收器 Override public void onReceive Context context Intent inten
  • Phonegap - cordova 在 Android 和 iOS 设备上延迟且缓慢

    我刚刚开始使用 zend studio 开始我的第一个 PhoneGap 项目 但是 在我构建并部署它之后 该应用程序非常慢 Android 和 iOS 均可 滚动滞后 如果我按下按钮 转到下一页的速度很慢 有什么办法可以提高它的性能吗 提
  • 使用 Android 的 Mobile Vision API 扫描二维码

    我跟着这个tutorial http code tutsplus com tutorials reading qr codes using the mobile vision api cms 24680关于如何构建可以扫描二维码的 Andr

随机推荐

  • 代理后面的 git Push 远程问题

    为了设置上下文 我尝试使用toto https github com cloudhead toto建立我的博客 我做到了 sudo gem install toto 并且宝石安装正确 Successfully installed rdisc
  • Android ADB 连接空主机名

    我使用 ADB over WiFi 连接到 Android 设备 当我打字时 adb connect
  • java.lang.ClassNotFoundException:javax.ws.rs.client.RxInvokerProvider

    我尝试使用 loginServlet 从 jsp 页面登录 它重定向到 servlet 但不进行身份验证并引发错误 这是代码 JSP 文件 div class container div class row div class box di
  • Powershell:如何将结果添加到数组(ForEach-Object -Parallel)

    我知道 用参数 using foo我可以在运行时使用来自不同运行空间的变量ForEach Object Parallel在 Powershell 7 及更高版本中 但是如何将结果添加回变量呢 常用参数 and using 不管用 例如 Al
  • 如何向 pandas 数据框添加额外的行[重复]

    这个问题在这里已经有答案了 如果我有一个空数据框 columns Date Name Action ID df pd DataFrame columns columns 有没有办法向这个新创建的数据框追加新行 目前我必须创建一个字典 填充它
  • 我可以从网格生成点云吗? [关闭]

    Closed 这个问题正在寻求书籍 工具 软件库等的推荐 不满足堆栈溢出指南 help closed questions 目前不接受答案 我正在尝试从网格生成点云数据 例如 Maya 的 obj 文件 但是 我只能在互联网上找到相反的情况
  • 我如何给此列表中的每个人加薪

    需要使用 for each 循环 每个人获得的加薪是 1000 会是这样吗 int raise 1000 for Person i people people add raise i 我正在处理这个 public ArrayList
  • C 中的多字节整数变量[重复]

    这个问题在这里已经有答案了 我想知道如何计算单引号中字符串的整数值 我的示例代码是 include
  • 在Python中,导入类与导入类的模块有什么优缺点?

    我正在为大约 30 名开发人员组成的团队编写一套 Python 编码指南 作为我的文档的基础 到目前为止我已经研究了谷歌Python风格指南 http google styleguide googlecode com和PEP 8 风格指南
  • 我可以将对象保存到 app.config 文件中吗?

    我需要为我的应用程序使用一个配置文件 它将保存每个实体的详细信息列表 例如
  • 检查php会话是否不存在

    我有以下 php 代码 哪个应该检查会话是否不存在 如果不存在 则用户重定向 问题是这个条件始终为真 即使会话确实存在 我的问题是如何修复它 尝试用 SESSION like
  • 隐藏 UITableView 搜索栏

    我有一个 UITableViewController 它以标准方式设置了 UISearchDisplayController 搜索栏位于 tableView 内 我希望搜索栏一开始是隐藏的 真正隐藏 而不仅仅是滚动消失就像在这个解决方案中一
  • 在 Haskell 中过滤斐波那契数列

    我正在尝试过滤包含斐波那契数字的列表 我需要的只是奇数 并且小于或等于N 这是我到目前为止所拥有的 fib n n 0 0 n 1 1 otherwise fib n 1 fib n 2 fibs n a a lt fib x x lt 1
  • NodeJS“readline”模块不输出提示

    使用 NodeJS 我试图制作一个 笔记 管理器只是为了好玩 但是当我尝试使用 readline question 来获取用户关于他们想要做什么的输入 即创建一个新笔记 删除一个笔记 则不会显示提示 关于如何解决这个问题有什么建议吗 项目链
  • 在堆栈上分配大于页面大小的缓冲区会损坏内存吗?

    在Windows中 堆栈的实现方式如下 指定的页面后面是提交的堆栈页面 它的保护标志受到保护 因此 当 thead 引用受保护页面上的地址时 会出现内存错误 这使得内存管理器将受保护页面提交到堆栈并清除该页面的受保护标志 然后保留一个新页面
  • Flask-restful 在同一个类中具有 get/ 和 post 与 json

    如果 api add resource User user 则用户的 get 方法有效 该行未注释 另一个 api add resource 是 反之亦然 使 post 方法起作用 我怎样才能让这两条路径都起作用 from flask im
  • 处理命令行参数时清理控制流 [C#]

    我正在处理一个基于命令行参数执行大量 if else 分支的程序 这是 C 语言 但我确信它也适用于 Java C 等 以下是总体概述 if args Length 0 do something if args Length gt 0 ar
  • 无法远程访问9200端口

    刚刚开始使用elasticsearch 5 4 0 首先我将其安装在Mac 本地 上 然后安装在服务器上 在 Mac 中 当我在浏览器中运行 http 本地主机 9200 http localhost 9200 它向我显示输出 name N
  • Json解析Python子进程

    这是代码 inputDomain subprocess Popen cat etc localdomains shell True stdout subprocess PIPE domains inputDomain stdout read
  • 对话框打开时布局混乱

    我面临着一个非常奇怪的错误 其中一个布局的父级是 ConstraintLayout 当对话框打开时 后面的布局会自动开始收缩和移动 请参阅随附的 gif 来了解有关该错误的信息 请检查我的代码 看看我是否做错了什么 这是我的布局