【问题标题】:android spinner material drop down behaviorandroid微调器材质下拉行为
【发布时间】:2015-10-12 13:33:35
【问题描述】:

我怎样才能创建一个微调器,它的下拉行为会喜欢 here

谢谢。

我对如何使其下拉行为像在视频中一样感兴趣。当我们单击微调器时,它不会在视图下方下拉。它的下拉视图显示在所选项目周围。

【问题讨论】:

  • 它的视图实际上取决于您的设备版本
  • @Pavan 你的意思是 android 版本吗?
  • 是的,在 android 版本中,您只需实现 Spinner 并检查。检查此stackoverflow.com/questions/6666826/…
  • 显示您实现了哪些代码以及它在您的设备上的外观

标签: android spinner dropdown


【解决方案1】:

Check documentationspinner 解释的很好

Spinner spinner = (Spinner) findViewById(R.id.spinner);
// Create an ArrayAdapter using the string array and a default spinner layout
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
        R.array.planets_array, android.R.layout.simple_spinner_item);
// Specify the layout to use when the list of choices appears
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// Apply the adapter to the spinner
spinner.setAdapter(adapter);

【讨论】:

    猜你喜欢
    • 2019-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多