我目前正在构建一个Android应用程序,使用户可以拍照并写下它的细节.该应用程序使用Sherlock库.
我已经实现了一个SherlockFragment来显示图像和一些EditText和TextView,使用户能够键入图像的信息.但是,当其中一个EditText处于焦点上时,所有字段都会向上推,软键盘会弹出.
这是我的布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linear"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#FFFFFF">
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="200dip"
android:layout_above="@+id/textView"
android:layout_marginTop="20dip"
android:layout_marginBottom="20dip"
android:contentDescription="desc" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Title:"
android:textStyle="bold"
android:layout_above="@+id/editTextSimple"
android:layout_marginBottom="2dip"
android:textSize="15sp"/>
<EditText
android:id="@+id/editTextSimple"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/textView1"
android:layout_marginBottom="4dip">
<requestFocus />
</EditText>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Description:"
android:textStyle="bold"
android:layout_above="@+id/editTextSimple1"
android:layout_marginBottom="2dip"
android:textSize="15sp"/>
<EditText
android:id="@+id/editTextSimple1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/textView2"
android:layout_marginBottom="12dip">
</EditText>
<Button android:textColor="#FF000000"
android:id="@+id/submitButton"
android:text="@string/memorySubmit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="24dip"
android:onClick = "submit"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
根据我的理解,在一个活动中,必须将其置于<activity android:windowSoftInputMode="...." >Android Manifest中以在调用软键盘时调整视图.但是,我们如何为片段设置它?
我最近下载了Osmosis,将.osm.pbf文件转换为.map文件.我在这个应用程序中使用Windows 7.我从他们的系统下载了最新的zip文件,并将mapfilewriter jar文件放入/ lib/default /文件夹中.但是,当我在.bat文件中运行此语句时,我一直收到此错误:
osmosis --read-pbf file=taiwanlatest.osm.pbf --mapfile-writer file=helloworld.map
Mar 19, 2013 7:34:49 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.42
Mar 19, 2013 7:34:49 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Mar 19, 2013 7:34:50 PM org.mapsforge.map.writer.osmosis.MapFileWriterTask <init>
INFO: mapfile-writer version: mapsforge-map-writer-0.3.0
Mar 19, 2013 7:34:50 PM org.mapsforge.map.writer.osmosis.MapFileWriterTask <init>
INFO: mapfile format specification version: 3
Mar 19, 2013 7:34:50 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
Mar 19, 2013 7:34:50 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for …Run Code Online (Sandbox Code Playgroud)