小编joh*_*nco的帖子

为什么我的进度条没有垂直居中?

我有以下布局......

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:background="@drawable/bg_generic_portrait">
  <ListView android:id="@android:id/list"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="@drawable/issue_list_item_background_normal"
            android:listSelector="@drawable/issue_background_selector"
            android:divider="@drawable/separator"
    >
  </ListView>
  <ProgressBar
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:layout_gravity="center"
    android:id="@+id/preloader"
    style="@android:style/Widget.ProgressBar.Large"/>

  <TextView android:id="@android:id/empty"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#FF0000"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

它看起来像这样...... http://i.stack.imgur.com/Ra5c6.png

我希望预加载器也能垂直居中,出了什么问题?

layout android view alignment

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

如何在弹性中嵌入两个以上的聚合?

我正在开发一个允许用户创建有关客户数据的报告的应用程序,该用户能够添加0个或多个分组字段。

我使用的是Elastic 2.2.0,因此,如果用户要按天分组,则按年龄分组,然后按性别分组,则程序会将以下查询发送给Elastic:

{
  "aggs": {
    "group_a": {
      "date_histogram": {
        "field": "transactionDate",
        "interval": "day"
      },
      "aggs": {
        "group_b": {
          "terms": {
            "field": "age"
          }
        },
        "aggs": {
          "group_c": {
            "terms": {
              "field": "sex"
            }
          }
        }
      }
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

{
  "error": {
    "root_cause": [
      {
        "type": "search_parse_exception",
        "reason": "Could not find aggregator type [group_c] in [aggs]",
        "line": 15,
        "col": 11
      }
    ]
  }
}
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?

elasticsearch

5
推荐指数
1
解决办法
2240
查看次数

标签 统计

alignment ×1

android ×1

elasticsearch ×1

layout ×1

view ×1