Tôi đã sử dụng Framelayour cho sự kiện nhấp chuột và nó hoạt động tốt trước 2 ngày nhưng không biết wat happend bây giờ nó không hoạt động.
Vui lòng ai đó giúp tôi.
Mã của tôi là như sau: Thiết kế:FrameLayout nhấp vào sự kiện không phải là bắn
<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>
Code:
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);
}
}
});
Tôi biết bạn đã làm một cái gì đó, nhưng bạn quên đặt "nhấp được" như một tham số trong FrameLayout của bạn. – Tsunaze