2016-07-22 6 views
0

enter image description here 問題のスクリーンショットをアップロードしました。確認してください... テキストビューのテキストとボタンが上になりますお互い。私はそれのためのテキストとスクロールバーのためのHTMLを使用して..... .....お手伝いをしてください!テキストとボタンがオーバーレイされました.....テキストビューの下部にボタンが固定されています

は、ここに私のコードです:

のxml:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@drawable/images" 
tools:context="com.example.acer.aartisangrah.alaganraya"> 

<ScrollView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:gravity="center"> 
    <TextView 
     android:id="@+id/textView4" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentStart="true" 
     android:layout_alignParentTop="true" 
     android:gravity="center" 
     android:textAppearance="?android:attr/textAppearanceLarge" /> 
</ScrollView> 

<Button 
    android:id="@+id/b2" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:onClick="decrease" 
    android:text="Decrease" /> 

<Button 
    android:id="@+id/b1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentRight="true" 
    android:onClick="increase" 
    android:text="Increase" /> 
</RelativeLayout> 

ここで私はHTML

CODE使用しているテキストビューのために:

tv=(TextView)findViewById(R.id.textView4); 
tv.setTextSize((float) 18.0); 
tv.setText(Html.fromHtml(getString(R.string.five))); 

をするテキストのテキストサイズを注意してくださいテキストビューで増減することができます....

+0

チェック画像 – Devk

答えて

0

してください。このようなあなたのコード:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@drawable/images" 
android:orientation="vertical" 
tools:context="com.example.acer.aartisangrah.alaganraya"> 

<ScrollView 
    android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:layout_weight="1" 
    android:gravity="center"> 

    <TextView 
     android:id="@+id/textView4" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:gravity="center" 
     android:textAppearance="?android:attr/textAppearanceLarge" /> 
</ScrollView> 

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

    <Button 
     android:id="@+id/b2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:onClick="decrease" 
     android:text="Decrease" /> 

    <Button 
     android:id="@+id/b1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentEnd="true" 
     android:onClick="increase" 
     android:text="Increase" /> 
</RelativeLayout> 

+0

画像を確認 – Devk

+0

私はコードを使用していますか? –

+0

申し訳ありませんが... dintを取得 – Devk

2

ビューの整列順序を指定していないためです。

例:android:layout_above="@+id/btn"またはandroid:layout_below="@+id/scrollbarを使用して、ビューを配置できます。

+0

チェック画像のLinearLayoutで – Devk

+0

入れてこれらのボタンの両方/ RelativeLayout(名前をbtnLayoutとして指定)スクロールビューに 'android:layout_above =" @ + id/btnLayout'を追加 –

関連する問題