我试图在Android中构建RadioGroup,默认情况下检查一个RadioButton.我想知道这是否可以通过XML而不是以编程方式完成.
以下代码片段似乎不起作用,因为我收到错误:
error: Error: No resource found that matches the given name (at 'checkedButton' with value '@id/rdb_positive')
Run Code Online (Sandbox Code Playgroud)
代码是:
<RadioGroup
style="@style/FormInputField"
android:orientation="vertical"
android:checkedButton="@id/rdb_positive"> <!-- Error on this line -->
<RadioButton
android:id="@+id/rdb_positive"
android:text="@string/answer_positive" />
<RadioButton
android:id="@+id/rdb_negative"
android:text="@string/answer_negative" />
</RadioGroup>
Run Code Online (Sandbox Code Playgroud)
它确实在某种程度上有意义,因为RadioButton的id是在RadioGroup中的属性设置之后定义的,但后来我想知道为什么有这样的属性可用.
苹果公司在App Store上出现问题,几周后它就解决了.
大约一个星期以来,我们为iPhone开发的公司的应用程序在iPad型号的App Store应用程序中不再可见.他们以前是可见的.iPad上仍然可以看到以iPad为目标的应用程序.
在Google上搜索计算机上的应用程序时,可以找到它们,使用iTunes下载并安装在iPad上.
使用Safari在iPad上搜索Google时,也可以在iPad上找到,下载和安装这些应用程序.
在iPhone 4(iOS 6.0)和iPod Touch(iOS 5.1.1)上,它们在设备上的App Store应用程序中可见.
在iTunesConnect中,应用程序设置为在我们的地理区域中可用.这些应用程序是针对SDK的4.3,5.0或6.0版本构建的,但它们都应该与6.0兼容.
我希望有人可以指出我在哪里寻找让iPad上的App Store应用程序中显示这些应用程序的正确方向.
先谢谢
编辑1:"iPad"和"iPhone"搜索结果均为空.
编辑2:添加了有问题的应用程序链接.
编辑3:删除编辑2
最近,当我试图在我的设备上运行我的Android应用程序时,我必须在实际启动之前从Eclipse运行它几次.
我试图重新安装JRE,JDK和IDE,我试图切换工作区.我还让Eclipse为Java VM使用更多的RAM.
我的IDE,JRE,JDK,ADT和ADT插件都是最新的.
对此有任何建议非常感谢.
运行时没有命令输出:'am start -n com.example.abstab/com.example.abstab.ActivityMain -a android.intent.action.MAIN -c android.intent.category.LAUNCHER'on device HT15CV805781
异常堆栈跟踪:
com.android.ddmlib.ShellCommandUnresponsiveException
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:408)
at com.android.ddmlib.Device.executeShellCommand(Device.java:453)
at com.android.ide.eclipse.adt.internal.launch.ActivityLaunchAction.doLaunchAction(ActivityLaunchAction.java:67)
at com.android.ide.eclipse.adt.internal.launch.ActivityLaunchAction.doLaunchAction(ActivityLaunchAction.java:109)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.doLaunchAction(AndroidLaunchController.java:1277)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.doLaunchAction(AndroidLaunchController.java:1289)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launchApp(AndroidLaunchController.java:1261)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.simpleLaunch(AndroidLaunchController.java:906)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.continueLaunch(AndroidLaunchController.java:748)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launch(AndroidLaunchController.java:640)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.doLaunch(LaunchConfigDelegate.java:322)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:238)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1047)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1251)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Run Code Online (Sandbox Code Playgroud)
会话数据:
eclipse.buildId=M20120914-1800
java.version=1.7.0_15
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments: -keyring /Users/myname/.eclipse_keyring -showlocation
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -keyring /Users/myname/.eclipse_keyring -showlocation
Run Code Online (Sandbox Code Playgroud) 我一直在关注如何创建类约束验证器的烹饪书,现在我正处于我要在validate()函数中添加违规的程度.
但是我的IDE通知我函数addViolation()并且addViolationAt()已被弃用.
有人能指出我如何使用该Context\ExecutionContextInterface::buildViolation()功能的正确方向吗?
$this->context 是一个实例 Symfony\Component\Validator\ExecutionContext
class ProtocolClassValidator extends ConstraintValidator
{
public function validate($protocol, Constraint $constraint)
{
if ($protocol->getFoo() != $protocol->getBar()) {
$this->context->addViolationAt(
'foo',
$constraint->message,
array(),
null
);
}
}
}
Run Code Online (Sandbox Code Playgroud)
将调用更改$this->context->addViolationAt()为简单时$this->context->buildViolation(),我得到以下异常:
UndefinedMethodException:尝试在剥离的路径 行23中的类"Symfony\Component\Validator\ExecutionContext"上调用方法"buildViolation" .您是否要调用:"addViolation"?
第23行具有以下代码:
$builder = $this->context->buildViolation($constraint->message)
->atPath('formField')
->addViolation();
Run Code Online (Sandbox Code Playgroud)