给定一个带有MultiSelectListPreference的SettingsActivity及其数组资源中的条目,值和默认值,即使Android知道应该检查它们,也不会将某些复选框绘制为已选中.单击未选中的项目时,该项目仍未选中(因为Android认为它取消选中已选中的项目).
项目可在此处获取:https://github.com/ImmersibleElf/MSLPBug
它似乎在API 21和22中运行良好,但在23中没有.这可能是回收视图中的错误吗?或者可能是什么原因?
SettingsActivity.java
package com.immersibleelf.mslpbug;
import android.os.Bundle;
import android.preference.PreferenceFragment;
import android.support.v7.app.AppCompatActivity;
public class SettingsActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Display the fragment as the main content.
getFragmentManager().beginTransaction()
.replace(android.R.id.content, new SettingsFragment())
.commit();
}
@Override
public void onPause() {
super.onPause();
}
public static class SettingsFragment extends PreferenceFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Load the settings from an XML resource
addPreferencesFromResource(R.xml.settings);
}
}
}
Run Code Online (Sandbox Code Playgroud)
的settings.xml
<?xml version="1.0" …Run Code Online (Sandbox Code Playgroud) android android-checkbox android-multiselectlistpreference android-6.0-marshmallow
这个Ember 模板代码 ......
<div class="detail bedrooms">
<span>Number of bedrooms:</span> {{rental.bedrooms}}
</div>
<div class="detail temperature">
<span>Current Temperature:</span> {{city-temperature location=rental.city}}
</div>
Run Code Online (Sandbox Code Playgroud)
如何将"25C"文本与"当前温度"在同一行上呈现,就像"旧金山"与"位置"在同一行上一样?
我试过让city-temperature组件只返回文本,但是(这里的第二个问题)如果文本来自远程ajax请求,组件甚至可能只返回文本,因为promise似乎需要一个DOM元素追加?
这个Ember应用程序可以在GitHub上找到.它是官方Ember.js教程应用程序的修改版本,添加了"当前温度"详细信息.