- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
这段代码代表了我真正的问题......
我正在研究一个 UI。更复杂。
我有一个自定义 View ,需要在左侧添加一个按钮。为什么?因为我有四个这个自定义 View 放在一边。那些按钮的 View 创建了一些闰 View !
我有一个包含按钮的简单布局。
我必须让他脱离他的布局父级,属性为 clipChildren="false"
但是按钮不响应onClickListener
。
我当然错过了什么,但是什么?
根本没有播放动画点击...连安卓的click歌曲都不播放...
java代码在那里没有效果..按钮的 id button2 工作。按钮的 id 按钮不起作用..
这是我的 xml 代码。
<LinearLayout
android:orientation="vertical"
android:background="#0000FF"
android:clipChildren="false"
android:layout_marginLeft="80dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:textColor="#FF0"
android:layout_marginLeft="-20dp"
android:text="@string/hello_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/button"
android:layout_marginLeft="-80dp"
android:layout_width="80dp"
android:layout_height="80dp" />
<Button
android:id="@+id/button2"
android:layout_width="80dp"
android:layout_height="80dp" />
</LinearLayout>
和 onCreate 方法:
Button buton1 = (Button) rootView.findViewById(R.id.button);
buton1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.wtf("-----", "Click");
Toast.makeText(getActivity(), "button1", Toast.LENGTH_LONG).show();
}
});
Button buton2 = (Button) rootView.findViewById(R.id.button2);
buton2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getActivity(), "button2", Toast.LENGTH_LONG).show();
}
});
最佳答案
尝试将按钮放回其父项中。
如果它在那里工作,请非常认真思考一下为什么您不希望此按钮存在于其父项中。这几乎总是一个坏主意,因为它会破坏事物(无论是在实践上还是在概念上)。
我怀疑问题在于按钮占用空间的其他东西正在消耗触摸事件。
关于java - Android,按钮根本不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25094824/
我遇到了一个似乎很独特的问题。我的 NSUbiquitousKeyValueStore 在模拟器中的启动之间根本不起作用。也就是说,我什至不是在谈论 iCloud 同步或类似的东西,我无法让它通过下面
首先,我使用的是 WiX 版本 3.5.2519.0,但我也在最新的 3.6 版本上测试了它,结果相同。 我很难确定 PatchFamily 究竟能过滤掉 torch 生成的差异的某些部分。按照手册中
我可以获取要呈现的“帮助主题”标题,但无法获取我定义的任何FIXTURES。 {{#each model}} 中的任何内容都不会渲染。这是我第一次使用 Ember,所以任何东西(字面意义上的任何东
我一直在尝试设置custom ajaxTransports for jQuery在我们的产品的某些场景下缩短某些工作流程。然而,我在让这些传输受到尊重方面取得了零成功(而我有很多工作 custom a
为什么纯无类型 lambda 演算经常被描述为无法使用? 有了合适的函数库,它会不会与任何其他函数式语言大致相同? 最佳答案 速度不是大问题。例如,您可以决定使用教堂数字但优化实现,以便像往常一样表示
我是一名优秀的程序员,十分优秀!