小编g12*_*23k的帖子

在ScrollView中查看并不占用所有位置

我在ScrollView中有一个RelativeLayout.我的RelativeLayout有android:layout_height="match_parent"但是视图不占用整个大小,它就像一个wrap_content.

有没有办法让真正的fill_parent/match_parent行为?

我的布局:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

    <ImageView
    android:id="@+id/top"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:scaleType="fitXY"
    android:src="@drawable/top" />

    <ImageView
    android:id="@+id/header"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/top"
    android:scaleType="fitXY"
    android:src="@drawable/headerbig" />

    <ImageView
    android:id="@+id/logo"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/header"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="3dp"
    android:src="@drawable/logo" />

    <ScrollView
    android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/bottom"
    android:layout_below="@+id/logo"
    android:background="@drawable/background" >

        <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">

             <ImageView
            android:id="@+id/dashboard01"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_above="@+id/dashboard02"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="30dp"
            android:src="@drawable/dashboard01"
            android:visibility="visible" />

            <ImageView
            android:id="@+id/dashboard02"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_alignParentRight="true"
            android:layout_marginRight="10dp"
            android:src="@drawable/dashboard02" />

             <ImageView
            android:id="@+id/dashboard03"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/dashboard02"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="40dp"
            android:src="@drawable/dashboard03"
            android:visibility="visible" />
         </RelativeLayout>
    </ScrollView>

    <ImageView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/logo"
    android:layout_centerHorizontal="true" …
Run Code Online (Sandbox Code Playgroud)

layout android scrollview

131
推荐指数
2
解决办法
4万
查看次数

如何更改JLabel的字体大小以获取最大大小

我有JLabel一个容器.字体的defaut大小非常小.我JLabel想要采取最大尺寸的文本.

我怎样才能做到这一点?

java size fonts containers jlabel

66
推荐指数
4
解决办法
29万
查看次数

找不到构建器启动配置

当我尝试导出我的Android应用程序的apk时,我收到此错误:

Export Wizard Error   
   Errors occurred during the build

Problems occured when invoking code from plug-in: "org.eclipse.resources".
   The builder launch configuration could not be found
   The builder launch configuration could not be found
Run Code Online (Sandbox Code Playgroud)

错误真的很奇怪,因为我可以使用模拟器或设备运行/调试应用程序.有什么可以防止这个错误?

TKX

eclipse android apk

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

ActionBar中的ProgressBar,例如带有Refresh的GMail应用程序

我想和Honeycomb平板电脑上的GMail应用程序做同样的事情.单击"刷新"按钮时,图标将替换为ProgressBar.我怎样才能做到这一点?

谢谢

gmail android tablet android-3.0-honeycomb progress-bar

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

9补丁转换为渐变

我想在我的Android应用程序上有一个底线的ActionBar.这条线应该只有4种颜色:我想要的是

为了获得这个效果,我使用9patch但不是显示4种颜色,而是用渐变替换它: 我得到了什么

这是我正在使用的9Patch.你知道我哪里错了,因为我不明白为什么:/

我想要的是

谢谢你的帮助 !

android nine-patch actionbarsherlock android-actionbar

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

首次启动时的自定义活动(初始化向导)

我想定义自己的"SetupWizard"应用程序.为此,我使用此intent-filter,它工作正常:

<intent-filter android:priority="5">
        <action android:name="android.intent.action.MAIN" />
        <action android:name="android.intent.action.DEVICE_INITIALIZATION_WIZARD" />
        <category android:name="android.intent.category.HOME" />
        <category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)

但是我不知道如何判断向导已经结束了.现在,它只是在我最后一次完成()调用之后循环.

我该怎么说呢?

TKX.

android wizard intentfilter android-intent

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

如何调整svg(使用蜡染)并显示它?

我有一个100x100像素的svg文件(例如).我正在使用Batik.

如果我这样做:

JSVGCanvas svg = new JSVGCanvas();
[...]
svg.setSize(10,10);
Run Code Online (Sandbox Code Playgroud)

它只会显示图片的这一部分,而不会显示已调整大小的图像.

你知道我怎么能显示调整大小的svg图片吗?

谢谢 ;)

java svg resize batik

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

ListPreference的值永远不会更新

我有一个ListPreference,但是当我点击一个项目时,该值不会更新.该getValue()总是返回同样的事情.

当我重新点击ListPreference该值时,遗憾的是没有改变.

我的代码:

        ListPreference lp7 = (ListPreference) findPreference("paramUpdate");
        lp7.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {

        public boolean onPreferenceChange(Preference preference, Object newValue) {
            ListPreference listPref = (ListPreference) preference;
        listPref.getValue();
            return false;
        }
    });
Run Code Online (Sandbox Code Playgroud)

首选项xml:

    <ListPreference android:key="paramUpdate"
            android:title="@string/paramUpdate"
            android:summary="@string/paramSummaryUpdate"
            android:entries="@array/update"
            android:entryValues="@array/updateValues"
             />
Run Code Online (Sandbox Code Playgroud)

价值观:

<string-array name="update">
    <item>24h</item>
    <item>48h</item>
    <item>72h</item>
    <item>@string/never</item>
</string-array>

<string-array name="updateValues">
    <item>24</item>
    <item>48</item>
    <item>72</item>
    <item>0</item>
</string-array>
Run Code Online (Sandbox Code Playgroud)

哪里错了?

android preferences sharedpreferences

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

InkWell 无法使用背景图像

我正在构建我的第一个 Flutter 应用程序,我想创建一个简单的布局:一个背景图像和一个位于其上的半透明材质按钮。

我的 Widget 树非常简单,但 InkWell / Ripple 不可见。为什么我有这种行为?

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Material(
      child: new Stack(
        children: <Widget>[
          new Container(
              decoration: new BoxDecoration(
                  image: new DecorationImage(
            image: new AssetImage("res/imgs/splashscreen_bg.png"),
            fit: BoxFit.cover,
          ))),
          new Center(
              child: new FlatButton(
                  onPressed: () {}, child: new Text("Hello world")))
        ],
      ),
    );
  }
}
Run Code Online (Sandbox Code Playgroud)

没有背景图像,InkWell 正在工作。我该怎么办?

谢谢

dart flutter

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

无法使用外部DLL:FileNotFoundException

我有2个项目.第一个只生成一个DLL.

第二个需要第一个DLL.但是当我从DLL调用一个方法时,我有一个FileNotFoundException,带有以下消息:

BDD,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null

我确定该文件存在.哪里我错了?

c# dll filenotfoundexception

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