Android UI在某些设备上未更新
我有一个应用程序,左边有Android UI在某些设备上未更新,android,user-interface,updates,android-constraintlayout,Android,User Interface,Updates,Android Constraintlayout,我有一个应用程序,左边有滑动面板布局(默认情况下隐藏),屏幕可见部分有主布局。将显示UI元素,例如TextViews、图标(使用vectors)和SeekBar 在此主布局中,将根据用户交互进行更新。使用ConstraintLayout创建布局 <com....SlidingPaneLayout layout_width="match_parent" layout_height="match_parent"> <android.support.cons
滑动面板布局
(默认情况下隐藏),屏幕可见部分有主布局。将显示UI元素,例如TextView
s、图标(使用vectors
)和SeekBar
在此主布局中,将根据用户交互进行更新。使用ConstraintLayout
创建布局
<com....SlidingPaneLayout
layout_width="match_parent"
layout_height="match_parent">
<android.support.constraint.ConstraintLayout
android:id="@+id/left_panel"
layout_width="200dp"
layout_height="match_parent">
...
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:id="@+id/main_layout"
layout_width="match_parent"
layout_height="match_parent">
...
<ImageView
android:id="@+id/iv_example_icon"
app:srcCompat="@drawable/ic_icon" />
...
</android.support.constraint.ConstraintLayout>
</com....SlidingPaneLayout>
...
...
...
这个布局没有什么奇怪的。组件正在使用从主线程调用的方法进行更新,如setText
、setImageResource
等。问题是,在某些设备上(上一次出现在三星J3、安卓5.1.1上),这些方法不起作用(它可以在数千台其他设备上工作)。元素被单击,但内容未更新(例如,当用户触摸图标时更改图标)。只有在显示滑动窗格
后(从左侧滑动),或活动恢复后,才会更新该窗格。有人知道什么可以阻止应用程序更新这些元素吗?它在新的更新之前运行良好。新更新带来:ConstraintLayout
,png背景,vector
图标
谢谢。发现了问题。将淡入颜色从半透明设置为透明解决了此问题
this.setSliderFadeColor(ContextCompat.getColor(context, android.R.color.transparent));
但我仍然不知道这其中的原因