小编yon*_*yon的帖子

进度条设置不可行

我有这样的布局:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal" 
android:background="@drawable/menu_background"
>

<ProgressBar 
  android:id="@+id/aPBar"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_centerInParent="true"
  style="@android:style/Widget.ProgressBar.Inverse"/>

 ...

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

在我的onCreate方法中,我这样做是为了首先隐藏ProgressBar:

LayoutInflater inflater = getLayoutInflater();
RelativeLayout layout = (RelativeLayout)inflater.inflate(R.layout.achievements_screen, null);

progressBar=(ProgressBar)layout.findViewById(R.id.aPBar);
progressBar.setVisibility(View.INVISIBLE);
Run Code Online (Sandbox Code Playgroud)

但是这一直ProgressBar是可见的......我也试过了View.GONE.

当我设置

android:visible="gone"
Run Code Online (Sandbox Code Playgroud)

在XML文件中,ProgressBar不显示,但我无法使其显示

 progressBar.setVisibility(View.Visible);
Run Code Online (Sandbox Code Playgroud)

android progress-bar

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

如何使用模板或typedef在float/double矢量类型之间进行选择?

定位不同浮点精度(float/double)的常用方法是使用typedef

typedef float Real;
//typedef double Real;
Run Code Online (Sandbox Code Playgroud)

或者使用模板

template<typename Real>
...
Run Code Online (Sandbox Code Playgroud)

这很方便,但是任何人都有想法如何使用CUDA类型float2/float3/...和make_float2/make_float3/...?当然,我可以为所有人制作#defines或typedef,但这看起来不是很优雅.

cuda

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

标签 统计

android ×1

cuda ×1

progress-bar ×1