以下scrollview私はデザインを作成しようとしている(と私は、この-__-でかなり悪いです)、水平方向に常に整列(私のスクロールビューは私のボタンで私のレイアウトを上にしてスクロールする必要がありますが、ボタンは常に表示/表示されなければならないことを意味します)Androidの設計:私はscrollviewと3つのボタンのセットを持っています3ボタン
私はすでにいくつかのソリューションを試しました。が、それは成功していません:(
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<RelativeLayout
android:id="@+id/header"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</RelativeLayout>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/scroll"
android:layout_above="@+id/footer"
android:layout_below="@+id/header">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/imageView1"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Chargement en cours"
android:id="@+id/TNom"
android:layout_below="@+id/imageView1"
android:layout_centerHorizontal="true" />
</RelativeLayout>
</ScrollView>
<RelativeLayout
android:id="@+id/footer"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_alignParentBottom="true">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+"
android:id="@+id/Bplus"
android:onClick="onClickSuivant"
android:layout_toLeftOf="@+id/Begale"
android:layout_toStartOf="@+id/Begale" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="="
android:id="@+id/Begale"
android:onClick="onClickSuivant"
android:layout_centerHorizontal="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:id="@+id/Bmoins"
android:onClick="onClickSuivant"
android:layout_toRightOf="@+id/Begale"
android:layout_toEndOf="@+id/Begale" />
</RelativeLayout>
NB:私は肝炎E「ヘッダ」部分の不要...しかし、私はそれを持っていたし、まさに私が必要であると考えられる最後のコードは....
:(のみ-__-を思えませんそして、私はこの上の2つの質問を持っていますデザイン(私は尋ねるが、私はすべてを尋ねる:p)
1 /私はImageView1に "最大"の高さにダウンロードされる画像のサイズを強制することができますか?風景... 10 * 15と15 * 10と言ってみましょう... 15 * 10の代わりに10 * 6.666になるようにするにはどうすればいいですか< =例です...私が持つ画像のサイズはわかりませんが、私は同じ高さに毎回それらをしたい知っている、幅)の比率に応じて変更されることがあり
2 /なぜリントEDIT
ここに停止し、私を与えるすべての人に事前に
android:textAppearance="?android:attr/textAppearanceLarge"
Thxをがヒント:) (と私の英語のため申し訳ありません)....赤でこの部分を書いている:私はいくつかの答えを発見しました!!私はここに私が望んで行うことをお勧めしますRELATIVELayoutの代わりのLinearLayout、...
シリコンを使用(誰もが興味を持っている場合、参照用)、「新しい」テンプレートで、私はまだ問題
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:id="@+id/scroll"
android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/imageView1"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Chargement en cours"
android:id="@+id/TNom"
android:layout_below="@+id/imageView1"
android:layout_centerHorizontal="true" />
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+"
android:id="@+id/Bplus"
android:onClick="onClickSuivant"
android:layout_toLeftOf="@+id/Begale"
android:layout_toStartOf="@+id/Begale" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="="
android:id="@+id/Begale"
android:onClick="onClickSuivant"
android:layout_centerHorizontal="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:id="@+id/Bmoins"
android:onClick="onClickSuivant"
android:layout_toRightOf="@+id/Begale"
android:layout_toEndOf="@+id/Begale" />
</LinearLayout>
を持っているところ
以前のデザインでは、ボタンはうまく調整され、すべての画面(match_parent)を取りました...この1つでは、左下に配置されています... android:layout_centerHorizontal = "true" RelativeLayout、問題はこれから来て...どのように私はそれを変更することができますか?
それは、@Ronandroid仕事でしたか? – Taisa
私は昨日の夕方に別のrelativelayoutを置くことで回避しました。(そして私はちょっと前にデビットに戻ってきました) リントに関しては、実際にはハードコーディングされた文字列ではありません(ハードコードされた文字列は、私が既にそれを知っていてもアドバイスのおかげで緑色になります:)この行はデバッグ目的のためだけです;)私はスピナーとtutti quantiを入れます) – Ronandroid
たくさん:) – Ronandroid