小编Are*_*eks的帖子

在窗口小部件上以编程方式设置ImageView宽度和高度

我正在使用下面的代码使用remoteview在小部件imageview上设置图像现在我想将高度和宽度设置为imageview运行时.

if (appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID) {
    AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(WidgetActivity1_1.this);
    RemoteViews remoteViews = new RemoteViews(WidgetActivity1_1.this.getPackageName(), R.layout.widget_layout1_1);
    Intent configIntent = new Intent(WidgetActivity1_1.this,UpdateWidgetService.class);
    configIntent.putExtra("Appid", appWidgetId);
    PendingIntent configPendingIntent = PendingIntent.getService(WidgetActivity1_1.this, appWidgetId, configIntent, 0);
    remoteViews.setImageViewResource(R.id.imgviewGrow, R.drawable.flower1);
}
Run Code Online (Sandbox Code Playgroud)

android android-widget

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

使用Holoeverywhere,使用ProgressDialog无法获得Holo的外观和感觉

我已导入库,没有错误或警告,但我无法使其工作.

这是我的ProgressDialog代码:

pDialog = new ProgressDialog(MyActivity.this);
pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
pDialog.setMessage("Message");
pDialog.setCancelable(false);
pDialog.show();
Run Code Online (Sandbox Code Playgroud)

我尝试过的:

  • 我尝试将Manifest中的App主题更改为:@android:style/Theme.Holo.Light并且无法正常工作
  • 我还试图像这样创建ProgressDialog实例: new ProgressDialog(Activity.this, R.drawable.dialog_full_holo_light);
  • 我正在扩展org.holoeverywhere.app.Activity;和导入org.holoeverywhere.app.ProgressDialog;

我不知道我错过了什么或为什么它不起作用.你能帮我么?

android android-holo-everywhere

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