小编chr*_*olr的帖子

如何隐藏WP7中的状态栏(Silverlight)

我正试图隐藏我的Silverlight Windows Phone 7应用程序顶部的statur栏.
我在搜索stackoverflow时发现了这个,但是对于Xna.

graphics = new GraphicsDeviceManager(this); 
graphics.IsFullScreen = true;
Run Code Online (Sandbox Code Playgroud)

我在我的应用程序中尝试过但它不起作用.我知道这是可能的,因为Board express和xda应用程序具有隐藏/显示状态栏的功能.

fullscreen statusbar windows-phone-7

7
推荐指数
2
解决办法
6882
查看次数

如何在打字稿和角度中使用 $scope.$on ?

我是打字稿新手,我正在尝试将此角度控制器转换为打字稿,但我在$scope.$on()方面遇到问题。

(function () {
'use strict';

angular.module('controllers').controller('NavigationController', ['$scope', '$location', 'NavigationServices',
    function ($scope, $location, NavigationServices) {

        var vm = this;

        vm.isSideBarOpen = NavigationServices.getSideBarState();

        vm.toggleSideBar = function () {
            NavigationServices.toggleSideBar();
        };

        $scope.$on('navigation:sidebar', function (event, data) {
            vm.isSideBarOpen = data;
        });

    }]);
})();
Run Code Online (Sandbox Code Playgroud)

我尝试过的打字稿:

module app.controllers {

import IScope = ng.IScope;
import ILocationService = ng.ILocationService;
import INavigationServices = app.services.INavigationServices;

interface INavbarController {
    isSidebarOpen: boolean;
    toggleSideBar(): void;
}

class NavbarController implements INavbarController {
    isSidebarOpen: boolean;

    static $inject = ['$scope', '$location', 'NavigationServices'];
    constructor(private …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs typescript

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

如何获取使用Volley ImageLoader下载的缓存位图?

问题:我有一定数量的ImageViews,我正在动态添加如下:

for (int i=2; i < result.size(); i++) {
        // instantiate image view
        ImageView mImageView = new ImageView(this);
        mImageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
        mImageView.setBackgroundResource(R.drawable.selectable_background_theme);
        mImageView.setOnClickListener(this);

        // download image and display it
        mImageLoader.get(result.get(i), ImageLoader.getImageListener(mImageView, R.drawable.ic_logo, R.drawable.ic_action_refresh));

        // add images to container view
        mLlDescContent.addView(mImageView);
    }
Run Code Online (Sandbox Code Playgroud)

想要能够点击图像并在全屏幕中将其显示在另一个活动中的内容.我已经阅读了几种方法,例如传递Uri或将实际的Bitmap作为字节数组传递.

问题:如何获取我使用Volley ImageLoader下载的Uri或实际位图.LruCache我正在使用我在这里找到的BitmapLruCache:Android Volley ImageLoader - BitmapLruCache参数?.有人可以用这个或任何想法来帮助我实现我的目标.

我在上面的代码之后尝试了这个并没有:

Bitmap mBitmap = VolleyInstance.getBitmapLruCache().getBitmap(result.get(2));
mIvAuthorImg.setImageBitmap(mBitmap);
Run Code Online (Sandbox Code Playgroud)

编辑:如果我重新请求图像:

mImageLoader.get(result.get(i), ImageLoader.getImageListener(mImageView, R.drawable.ic_logo, R.drawable.ic_action_refresh));
Run Code Online (Sandbox Code Playgroud)

图像是从缓存加载的,但是如果我尝试直接从缓存中访问图像:

Bitmap mBitmap = VolleyInstance.getBitmapLruCache().getBitmap(result.get(2));
mIvAuthorImg.setImageBitmap(mBitmap);
Run Code Online (Sandbox Code Playgroud)

图像不加载.我希望能够操作图像,例如在将图像传递给下一个活动之前调整大小.

android bitmap android-imageview android-volley

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

为什么要跳过这个if语句?

无论如何可以告诉我为什么跳过以下if语句?我想检查我的mAlphabetCode是否包含0-9字面值,而不是0到9.

        // check if alphabet code is numeric
        if (mAlphabetCode.equals("0-9")){
            mAlphabetCode = "-";
        }
Run Code Online (Sandbox Code Playgroud)

这是整个代码:

    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

    if (parent.getId() == R.id.lv_gl_content) {
        // store data to be pass
        Intent mIntent = new Intent(this, AchList.class);
        mIntent.putExtra("mPageUrl", mGameList.get(position).getItemPageUrl());
        mIntent.putExtra("mGameTitle", mGameList.get(position).getTitle());

        // start activity and page animation
        startActivity(mIntent);
        mPageTrans.slideIn();

    } else if (parent.getId() == R.id.lv_alphabet_content) {
        // get alphabet code
        String mAlphabetCode = parent.getAdapter().getItem(position).toString().toLowerCase();

        // check if alphabet code is numeric
        if (mAlphabetCode.equals("0-9")){
            mAlphabetCode …
Run Code Online (Sandbox Code Playgroud)

java android if-statement

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