Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 ViewFlipper,它呈现 3 个不同的视图。
是否可以让 3 个类管理* 3 个不同的视图?如果是这样,我该怎么做?
你为什么不让你的News和Prices类包含你所说的所有应用程序逻辑。如果你让它们扩展ListView,你可以将它们添加到你的ViewFlipper中并以相同的方式对待它们,但是它们将具有由你放入News和Prices类中的任何内容所决定的特定行为。
News
Prices
ListView
ViewFlipper
或者,只需为 ViewFlipper 中的每个 ListView设置不同的listView.setAdapter()[to populate] 和[to alter behavior]。listView.setOnItemSelectedListener()
listView.setAdapter()
listView.setOnItemSelectedListener()