【发布时间】:2013-06-03 09:26:00
【问题描述】:
我已将 Framelayour 用于单击事件,并且在 2 天前工作正常,但不知道发生了什么,现在它无法正常工作。
请有人帮助我。
我的代码如下:
设计:
<FrameLayout
android:id="@+id/flWebpre"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1" >
<WebView
android:id="@+id/wvWebsite"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<ProgressBar
android:id="@+id/pbWebsite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/white"
android:layout_gravity="center_horizontal" />
</FrameLayout>
代码:
FrameLayout flWebPre = (FrameLayout) findViewById(R.id.flWebpre);
flWebPre.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if (isExpanded) {
isExpanded = false;
new CollapseAnimation(slidingPanel, panelWidth,
TranslateAnimation.RELATIVE_TO_SELF, 0.70f,
TranslateAnimation.RELATIVE_TO_SELF, 0.0f, 0, 0.0f,
0, 0.0f);
}
}
});
【问题讨论】:
-
我知道您已经做了一些事情,但是您忘记将“可点击”作为参数放在 FrameLayout 中。
标签: android android-framelayout