我使用MvvmCross编写了简单的adnroid应用程序。只有两个活动。第一个是LoginActivity,它包含两个文本框和按钮。在调试模式下使用时工作正常。当链接器设置为无时,它也可以在归档后工作。 问题是当我将Linker设置为SdkAssembilesOnly应用程序运行时,但是当单击按钮时没有任何反应。我认为绑定不起作用。
prepend_before_action :check_captcha, only: [:create] # Change this to be any actions you want to protect.
private
def check_captcha
unless verify_recaptcha
self.resource = resource_class.new sign_up_params
respond_with_navigational(resource) { redirect_to :back }
end
end
在浏览互联网时,我发现有些人使用LinkerPleaseInclude.cs - 我应该在这个类中添加什么才能使它有效?
答案 0 :(得分:2)
是 - 使用以下方法添加LinkerPleaseInclude
类:
public void Include(Button button)
{
button.Click += (s, e)
=> button.Text = $"{button.Text}";
}
另外,请确保LinkerPleaseInclude
上有[Preserve(AllMembers = true)]
属性。