我有WebView一个ViewPager.并且ViewPager似乎消耗了所有的水平滚动,因此我无法滚动WebView(垂直工作).
如何实现WebView优先消耗水平滚动?
我WebView在ViewPager... 的底部有一个...当我滑过的项目ViewPager.视图向下移动.(我想重点是webview)我不确定这是否是由于WebView.使用html数据加载webview
webView.loadDataWithBaseURL(null, data, "text/html","utf-8",null);
每次加载下一个项目时页面向下移动都很烦人.我有一个ImageView在视图的顶部
有什么指针吗?
这是xml:
<ScrollView
android:id="@+id/scroll_view_1"
style="@style/some_style"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fadingEdge="none" >
<LinearLayout
android:id="@+id/linear_layout_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/some_drawable"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/relative_layout_1"
android:layout_width="fill_parent"
android:layout_height="250dp"
android:paddingLeft="5dip"
android:paddingRight="5dip" >
<LinearLayout
android:id="@+id/linear_layout_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="5dip"
android:gravity="center" >
<PageIndicator
android:id="@+id/page_indicator"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dip" />
</LinearLayout>
<RelativeLayout
android:id="@+id/relative_layout_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:visibility="visible" >
<TextView
android:id="@+id/text_view_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dip"
android:text="1/50"
android:textColor="#000000"
android:textSize="16sp" />
<ImageView
android:id="@+id/image_view_1"
android:layout_width="35dip"
android:layout_height="35dip"
android:layout_marginRight="5dip"
android:layout_toLeftOf="@id/text_view_1"
android:scaleType="centerInside" …Run Code Online (Sandbox Code Playgroud) 我设计了我的 mysql 表id作为主键。我的表已经填充了数据。现在,我想将我的id列更改为uuid并将所有填充数据的id字段更改为uuid. 我正在考虑用 php 来做这件事。有没有其他选择?
我是PHP和MYSQL的新手.我有这个表单用于将数据输入到我创建的数据库中.我将来自两个字段的值添加到单独的列中,并将值插入第三列(TOTAL_IN).然后我从第三列(TOTAL_IN)中的字段中的值中减去另一个字段中的另一个值(VALUE3),并将该值放在不同的列中.所有这些都在同一张桌子上.它工作正常,但问题是,当我打开我的数据库时,我看到数据已被插入20或100次!如何阻止数据插入这么多次?
请注意,提交按钮只被点击一次.
这是我使用的:
$sql="INSERT INTO $tbl_name (id, date, value1, value2, total_in, value3, value4)
SELECT '','$date','$value1','$value2',('$value1'+'$value2') AS SUM,
'$value3',(('$value1'+'$value2')-$value3) AS SUM
FROM $tbl_name";
$result=mysql_query($sql);
Run Code Online (Sandbox Code Playgroud)
任何帮助?
提前致谢!
编辑:::以下是我的代码在你的建议之后的样子:
//From Ruddy's post
$total_in=$value1+$value2;
$value4=($value1+$value2)-$value3;
//From Amit's post
$sql="INSERT INTO $tbl_name(id, date, value1, value2, total_in, value3, value4) VALUES ('', '.$date.', '.$value1.', '.$value2.', '.$total_in.', '.$value3.', '.$value4.')";
$result=mysqli_query($sql);
Run Code Online (Sandbox Code Playgroud)
它工作但它仍然多次输入数据.