我m using last AS and testing on a real device with sdk 15. Using usual appcompat behavior to set action bars. For one activity I need to set a spinner to have filter on it. I
这样做。
((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayShowHomeEnabled(false);
((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayShowCustomEnabled(true);
((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayShowTitleEnabled(false);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(getActivity(),
R.array.guestsFilter, R.layout.spinner_filter);
adapter.setDropDownViewResource(R.layout.spinner_drop_list);
Spinner mFilterSpinner = new Spinner(((AppCompatActivity) getActivity()).getSupportActionBar().getThemedContext());
mFilterSpinner.setAdapter(adapter);
((AppCompatActivity) getActivity()).getSupportActionBar().setCustomView(mFilterSpinner);
一切都适用于23 sdk模拟器,但不适用于15 sdk的真实设备。问题是三角形可以在下拉处附近绘制。它是深色的。我认为它应该可以工作,因为兼容性。有什么建议吗?
答案 0 :(得分:0)
所以,因为这是由于机器人本身的故障,我决定将功能移到菜单上以获得较低的apks。