小编tco*_*ooc的帖子

ScrollView中的ListView不在Android上滚动

我在滚动ListView里面遇到麻烦ScrollView.我有一个Activity在顶部有一些EditTexts,然后是一个带有两个选项卡的选项卡主机,每个选项卡都有一个ListView.当EditText视图聚焦时,软键盘出现,因为我有一个ScrollView,内容是可滚动的.但问题出现在ListViews中有更多项目(选项卡中的项目),即使有更多项目,我也无法滚动ListView.

以下是布局XML:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="?backgroundImage"
    android:orientation="vertical">

  <LinearLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="50dip"
        android:layout_alignParentBottom="true"
        android:layout_margin="10dip"
        android:id="@+id/buttons">
    <Button
            android:text="Save"
            android:layout_margin="2dip"
            android:textSize="20dip"
            android:id="@+id/btnSaveorUpdate"
            android:layout_height="wrap_content"
            android:layout_width="145dip"></Button>
    <Button
            android:text="Cancel"
            android:layout_margin="2dip"
            android:textSize="20dip"
            android:id="@+id/btnCancelorDelete"
            android:layout_height="wrap_content"
            android:layout_width="145dip"></Button>
  </LinearLayout>
  <ScrollView
        android:layout_above="@id/buttons"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:fillViewport="true"
        android:layout_margin="10dip">
    <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_margin="10dip">
      <TextView
                android:text="Bill details"
                android:textColor="?textColorDark"
                android:layout_alignParentTop="true"
                android:id="@+id/txtEnterDetails"
                android:textSize="25dip"
                android:textStyle="bold"
                android:layout_height="wrap_content"
                android:layout_width="fill_parent"
                android:layout_marginBottom="2dip"></TextView>
      <LinearLayout
                android:focusable="true"
                android:focusableInTouchMode="true"
                android:layout_width="0dip"
                android:layout_height="0dip" />
      <EditText
                android:layout_width="fill_parent"
                android:hint="Enter data"
                android:inputType="numberDecimal"
                android:id="@+id/txtSample"
                android:textSize="@dimen/editText"
                android:layout_height="@dimen/editTextHeight"
                android:text=""></EditText>
      <EditText
                android:layout_width="fill_parent"
                android:id="@+id/txtDescription"
                android:hint="Enter description"
                android:textSize="@dimen/editText" …
Run Code Online (Sandbox Code Playgroud)

android listview scrollview android-layout

151
推荐指数
9
解决办法
20万
查看次数

在Openpyxl中设置样式

我需要在Openpyxl中设置样式的建议.

我看到可以设置单元格的NumberFormat,但我还需要设置字体颜色和属性(粗体等).有一个style.py类,但似乎我无法设置单元格的样式属性,我真的不想开始修改openpyxl源代码.

有没有人找到解决方案?

python excel xlsx openpyxl

42
推荐指数
6
解决办法
6万
查看次数

HTML5文件API读作文本和二进制文件

我目前正在研究HTML5文件API,我需要获取二进制文件数据. The FileReaderreadAsText,readAsDataURL方法工作正常,但readAsBinaryString返回相同的数据readAsText.

我需要二进制数据,但我得到一个文本字符串.我错过了什么吗?

html javascript html5 file

31
推荐指数
1
解决办法
10万
查看次数

从所选下拉列表的数据属性中获取值

我正在尝试从下拉列表的选定选项中选择数据属性,然后将其放在文本框中.这也是我的第二个数据属性.我将在用户更改选项时添加代码(代码我已经编写并可以在这里抽象),但我希望首先使用此部分.

HTML

<select class="operations-supplier" name="operations-supplier">
    <option data-selected="latam" data-capacity="100000" value="
        10">LATAM - Supplier A</option>
    <option data-selected="na" data-capacity="200000" value="20>">NA - Supplier B</option>
    <option data-selected="asia" data-capacity="300000" value="30">ASIA - Supplier C</option>
</select>
<input type="text" class="operations-supplierCapacity" readonly />
Run Code Online (Sandbox Code Playgroud)

JQuery的

var capacityValue = $('select.operations-supplier').find(':selected').attr('data-capacity').val();
$('.operations-supplierCapacity').val(capacityValue);
Run Code Online (Sandbox Code Playgroud)

的jsfiddle

html javascript jquery

17
推荐指数
1
解决办法
6万
查看次数

为什么fetch返回status = 0的响应?

我想使用fetch API从URL获取整个HMTL文档.

let config = {
method: 'GET',
headers: {
    'Content-Type': 'application/json',
    'Accept': 'text/html',
    'Accept-Language': 'zh-CN',
    'Cache-Control': 'no-cache'
},
mode: 'no-cors'};

fetch('http://www.baidu.com', config).then((res)=> {
console.log(res);}).then((text)=> {});
Run Code Online (Sandbox Code Playgroud)

在chrome中运行代码,它触发一个请求并在chrome网络中返回html.但获取res返回:

在此输入图像描述

为什么状态是如何以及如何获得正确的res像chrome newwork中的那样?

javascript ajax frontend

14
推荐指数
1
解决办法
1万
查看次数

搜索页面的漂亮网址

我真的很喜欢拥有"漂亮"的URL(例如/Products/Edit/1代替/products.aspx?productID=1),但我对于如何为可以通过大量变量搜索的页面执行此操作感到茫然.

例如,假设您有一个页面,允许用户搜索具有特定名称且靠近特定地址的特定类型的所有产品.你会用很长的"漂亮"网址做到这一点吗?

/Products/Search/Type/{producttype}/Name/{name}/Address/{address}
Run Code Online (Sandbox Code Playgroud)

或者只是使用url params

/Products/Search?productType={producttype}&name={name}&address={address}
Run Code Online (Sandbox Code Playgroud)

routing

9
推荐指数
3
解决办法
5512
查看次数

Google App Engine App.yaml配置跳过文件以忽略Mercurial文件

我在skip_files的顶部添加了一行,以使app引擎部署跳过以.hg开头的所有文件,例如.hgignore文件和.hg目录.这会忽略整个.hg目录及其所有文件和子目录吗?

skip_files:
- ^(.*/)?\.hg*$
- ^(.*/)?app\.yaml
- ^(.*/)?app\.yml
- ^(.*/)?index\.yaml
- ^(.*/)?index\.yml
- ^(.*/)?#.*#
- ^(.*/)?.*~
- ^(.*/)?.*\.py[co]
- ^(.*/)?.*/RCS/.*
- ^(.*/)?\..*
Run Code Online (Sandbox Code Playgroud)

mercurial google-app-engine yaml

8
推荐指数
1
解决办法
5705
查看次数

HTML5文件和文件列表路径

我想知道文件路径存储在HTML javascript中的File对象中的哪个位置.

我使用了Webkit DevTools并得到了这个:

FileList
0: File
    fileName: "script.js"
    fileSize: 71268
    name: "script.js"
    size: 71268
    type: "application/x-javascript"
    __proto__: File
length: 1
__proto__: FileList
Run Code Online (Sandbox Code Playgroud)

文件名,大小和类型都在那里(任何人都知道为什么名称和大小有2个变量),但路径不是.

有没有办法找到文件的路径,如果没有,浏览器和javascript如何读取文件(如POST方法和确定类型和大小)?

html javascript html5 file

7
推荐指数
1
解决办法
7097
查看次数

从它调用的函数中中止外部函数

是否可以youth从内部执行返回/停止执行box?直接,不是这样的:

function youth(){
  var check = true;

  function box(){
    //code
    check = false;
  }

  //code
  while(check){
    //code;
  }
  return false;    
}
Run Code Online (Sandbox Code Playgroud)

(有check变量的变量box)

javascript closures function

4
推荐指数
1
解决办法
527
查看次数

4
推荐指数
2
解决办法
6193
查看次数