小编Bob*_*ano的帖子

Android ScrollView在子imageview的顶部和底部添加了额外的填充

我在渲染ScrollView时遇到问题.基本上,布局是固定的页眉和页脚,中间有一个滚动视图.我们的想法是,当为内容EditText激活屏幕键盘时,如果图像的高度比中间视图长,则可以滚动图像.

在测试布局时,我发现在我的Android手机(Xperia X10 Android 1.6)上,在ImageView的顶部和底部添加了一大堆填充.

我很感激有关如何防止这种情况发生的任何建议.

<?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">

    <!-- Header -->
    <RelativeLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="#FFFFFF">
        <TextView
            android:text="Share your photo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="left"/>
        <Button
            android:id="@+id/btnStack"
            android:text="Stacks"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"/>
    </RelativeLayout>
    <!-- End Header -->


    <!-- Body -->
    <ScrollView
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:padding="5px"
        android:background="#CCCCCC">
        <ImageView
            android:id="@+id/imgPreview"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"/>
    </ScrollView>
    <!-- End Body -->


    <!-- Footer -->
    <RelativeLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="#FFFFFF"
        android:layout_alignParentBottom="true">
        <EditText
            android:id="@+id/caption"
            android:text="Type your caption"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"/>

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/caption" …
Run Code Online (Sandbox Code Playgroud)

android emulation scrollview imageview

16
推荐指数
3
解决办法
2万
查看次数

在Redis中存储地理空间数据的方法

我有一个MySQL表,包含大约100万个纬度和经度,每行有一个主键值.

我想通过Geohashing或lat和lon排序集将此表迁移到Redis中.

有没有人这样做过?您用于存储和查询数据的方法是什么(例如:在Google地图的纬度/经度范围内查询数据).

redis

9
推荐指数
1
解决办法
4959
查看次数

Redis:根据哈希字段值从排序集中排除值

我想知道是否有人可以提供一些关于如何使分类集生成更有效的建议?

我正在开发一个项目,其中排名数据按小时计算并存储在数据库中.数据可以按成员性别,国家等进行过滤.大约有200万行需要处理,需要很长时间.

我们希望采用更实时的方法,在Redis中进行数据存储/排序/过滤以及每日清理重建.

在我的原型中,我正在为每个可能的过滤器组合创建一个有序集合,例如:leaderboard.au.male,leaderboard.au.female等.我编写了这个过程但是一旦你处理完每个案例就意味着有118个排序集创建.

理想情况下,我希望为每个包含其名称,性别和国家/地区的成员设置一个排名排序集和哈希集.然后使用Redis仅根据用户定义的过滤器返回已排序的设置值.(例如,只获得澳大利亚男性的排名).

这可以在Redis中原生吗?

sorted set redis

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

如何避免使用ember-simple-auth OPTIONS调用?

我正在使用Ember Simple Auth构建一个在主域上运行并与子域上的API对话的应用程序.

在我的开发环境中,我遇到了将承载令牌传递给API的问题,因为应用程序在端口9000上运行,而api在8080上运行,我将8080 API URL列入白名单并在我的.htaccess文件中添加了一些额外的标头:

Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:Authorization, X-Requested-With, Content-Type, Origin, Accept
Access-Control-Allow-Methods:GET, OPTIONS, POST, HEAD, DELETE, PUT
Access-Control-Allow-Origin:*

现在,在每个请求之前,简单的auth进行OPTIONS调用,然后进行API调用.我无法控制API,所以有什么方法可以改变它吗?

如果不可能,OPTIONS方法是否应该包含一个正文?

ember.js

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

标签 统计

redis ×2

android ×1

ember.js ×1

emulation ×1

imageview ×1

scrollview ×1

set ×1

sorted ×1