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.
我正在开发一个必须实现添加和编辑功能的应用程序。我正在使用一个片段,我正在向该片段传递一个安全参数,当我传递参数时它在编辑模式下工作正常,但它在添加模式下崩溃,因为这次我没有传递任何参数。是否可以不根据条件传递参数?
为参数添加一个空值。然后在编辑和添加屏幕中,检查是否为空。如果 value 为 null,则它是一个 Add。如果不为空,则为编辑。