所以我有一个引人入胜的问题.尽管我不是手动或以编程方式滚动我的视图,但我的WebView会在其内部数据加载后自动滚动到.
我在viewpager中有一个片段.当我第一次加载寻呼机时,它按预期工作,并显示所有内容.但是一旦我"翻页",数据就会加载,WebView会弹出到页面顶部,将视图隐藏在它上面,这是不可取的.
有谁知道如何防止这种情况发生?
我的布局看起来像这样:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/background" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/article_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="2dp"
android:text="Some Title"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/article_title"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/LL_Seperator"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="@color/text"
android:orientation="horizontal" >
</LinearLayout>
<WebView
android:id="@+id/article_content"
android:layout_width="match_parent"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/article_link"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:text="View Full Article"
android:textColor="@color/article_title"
android:textStyle="bold" />
</LinearLayout>
</ScrollView>
Run Code Online (Sandbox Code Playgroud)
我也没注重任何事情.默认情况下,它似乎在加载后自动滚动到WebView.我该如何防止这种情况?
android android-layout android-webview android-scrollview android-viewpager
我需要从FTP服务器下载所有内容到托管在不同的服务器上.我只有shell访问我正在下载文件的服务器.如何使用Linux FTP命令下载每个文件,在此过程中创建所需的目录?
是否有用于解码QR码的简单PHP实现?
我有一个人造智能手机.其中一款手机作为智能手机游行,但我无法下载任何应用程序,我想创建一个电子邮件服务,我可以拍摄二维码的照片,彩信到这封电子邮件,电子邮件返回QR码包含什么.
但是,我能找到的唯一库是Python(可能还有C++),我在有限的托管环境中都无法访问这些库.
有没有办法只使用PHP读取QR码?
有没有办法通过纬度和经度获得用户的时区?而不只是偏移量,而是它们所处的实际时区.
基本上,我正在搜索DateTimeZone :: getLocation的极性相反,它返回某个时区的纬度和经度.
某些Google网站(例如GMail,Google Voice等)在后台更新时会显示一点蓝点(当窗口没有焦点时).这绝对是通过JavaScript API完成的.我已经看过至少一个其他网站(imo.im)也这样做了.
你如何在JavaScript中实现这一点?
如果你不完全确定我在说什么,这是一张图片:

我有这个函数负责将文件名和mime-type转换成更"人性化"的东西(例如file.png,image/png到[Image,PNG]).我发现有趣的是,if() elseif()语句组的复杂度高于switch(true)语句.
使用以下代码,PHP Mess Detector输出一个4410的NPath:
public function humanKind()
{
$typeRA = explode("/", strtolower($this->type));
$fileRA = explode(".", $this->name);
$fileType = strtoupper($fileRA[count($fileRA) - 1]);
switch($typeRA[0]) {
case "image":
$humanType = "Image";
break;
case "video":
$humanType = "Video";
break;
case "audio":
$humanType = "Sound";
break;
case "font":
$humanType = "Font";
break;
default:
$humanType = "File";
}
switch ($this->type) {
case "application/msword":
case "application/pdf":
case "applicaiton/wordperfect":
case "text/plain":
case "text/rtf":
case "image/vnd.photoshop":
case "image/psd":
case "image/vnd.adobe.photoshop":
case "image/x-photoshop":
case "application/xml": …Run Code Online (Sandbox Code Playgroud) 我正在尝试在网站上实施Facebook注册.如果没有onvalidate参数,一切都会像人们期望的那样工作,但是当包含它时,一切似乎都会崩溃(没有抛出错误,表单什么都不做).
这是我的代码:
<center>
<fb:registration redirect-uri="http://im.localhost/register"
fields='[{"name":"name"},{"name":"username","description":"Website Username","type":"text"},{"name":"email"},{"name":"password","view":"not_prefilled"},{"name":"captcha","view":"not_prefilled"},{"name":"tos","type":"checkbox","description":"I accept the Terms of Service"}]' onvalidate='validate'>
</fb:registration>
</center>
<script>
function validate(form) {
console.log('Validation');
errors = {};
errors.tos = "You must accept the terms of service";
return errors;
}
</script>
<!-- at end of page: -->
<script>
// ...
FB.init({
appId: '<?php echo IM_Facebook::getAppIDStatically(); ?>',
channelUrl: '<?php echo $this->serverUrl().$this->baseUrl('/xsrd.html'); ?>',
status: true,
cookie: true,
xfbml: true
});
// ...
</script>
Run Code Online (Sandbox Code Playgroud)
在点击表单的提交按钮时,从不调用console.log函数.(但是,否则它几乎正常 - 弹出"你已经使用abc注册"显示并在我点击确认时消失 - 但没有其他事情发生.
如果我在没有此参数的情况下将自定义字段(用户名)留空,Facebook会要求我填写它.如果我将此参数留空,则不会调用validate函数,也不会显示任何错误.无论哪种方式,根据这种形式应该总是显示的TOS错误永远不会出现.
类似问题的问题涉及网站URL与应用程序的URL不匹配.在这种情况下,情况并非如此.
对于域名澄清,我使用的域名为"im.localhost",无法通过互联网访问.我不相信这是一个问题,因为如果没有onvalidate注册表单工作,登录系统我已经实现了工作.但是,使用onvalidate,注册表将根本不再起作用.
javascript facebook registration xfbml facebook-social-plugins
好吧,在50号公路上又是一个有趣的问题.
我们希望实现一个真正的论坛灯泡系统,其中用户未读的帖子(在用户的帐户创建之后)显示为未读,直到该状态被清除或用户读取它们为止.
我们认为最好和最简单的方法是实现一个未读消息表.
列是:user_id,board_id,thread_id,post_id,timestamp,和hidden
这对于查看每个用户未读(并链接到它们)的板/线程/帖子非常有效且非常快,但是即使只运行一个SQL查询,用户发布到论坛的速度也很慢:
INSERT IGNORE INTO `forums_lightbulb` SELECT `id`,'x','x','x',UNIX_TIMESTAMP(),0 FROM `users`
Run Code Online (Sandbox Code Playgroud)
我确信这是拥有3065个用户帐户的结果.我怎样才能加快这个过程?我宁愿尽可能保持系统的实时性.
重要说明:请将您的答案限制在共享托管环境中,无需额外预算.我们仅限于PHP和MySQL 5.1.53-log
我有一个普通的老式手机没有特殊的应用程序系统,并使用Java(我假设ME)为您可以使用的少数应用程序.
这仍然是一个不错的用户群,我想开始为这种类型的手机编程.我已经了解基本的Java理论和语法,所以..我在哪里开始编程非智能手机?
我一直在拼命地解决这个问题,我的ListView项目突出显示.我已经回顾了我在stackoverflow上可以找到的任何解决方案,并且发现没有一个对我有用.
首先,这是LinearLayout中ViewPager中LinearLayout中的ListView.
Listview中的每个Item都是包含LinearLayout(包含TextView)和Gallery的LinearLayout.图库包含多个LinearLayouts,其中包含FrameLayout中的TextView和Imageview.
出现此问题,不是在点击时,而是在拖动时,如在手指滑过故事时(有时在ListView滚动时拖动),下面的项目将被选中.此外,此特定问题仅发生在滚动效果不会导致滚动时反弹的设备上.
试图解决这个问题的方法如下:
android:cacheColorHint为#00000000(什么都没做?)任何帮助,将不胜感激.我只是想不通为什么它这样做,我真的需要它停下来.
