【问题标题】:Soft keyboard appears, Background image is resized出现软键盘,调整背景图像大小
【发布时间】:2011-07-15 02:37:33
【问题描述】:

我的屏幕底部有一个带有编辑文本和按钮的 ListView。当软键盘出现时,它会挤压我的图像。我尝试了一些东西:

1)android:windowSoftInputMode="adjustPan" 图像没有被压扁,很好。但是 ListView 项目不能再滚动了。

2)android:windowSoftInputMode="adjustResize" 什么都不做。

有什么想法吗?

【问题讨论】:

    标签: android-layout


    【解决方案1】:

    在您的活动中使用 getWindow().setBackgroundDrawable() 来设置背景。

    【讨论】:

      【解决方案2】:

      使用 android:windowSoftInputMode="adjustResize" 并简单地将背景包装到 ScrollView 中的 ImageView 中。

      <ScrollView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:scrollbars="none"
          android:overScrollMode="never">
          <ImageView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"/> 
      </ScrollView>
      

      【讨论】:

        猜你喜欢
        • 2015-07-05
        • 2011-05-16
        • 2015-06-18
        • 2017-02-25
        • 2019-11-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多