0

私はアンドロイド開発/SmartEyeGlass SDKが初めてで、画面の正中線の上に何か(テキスト、画像など)を置くことができるかどうか疑問に思っています. <ImageView>をlayout.xmlに入れてエミュレーターにロードすると、画像の上端が画面の中央に表示されます。可能であれば、どんな提案も大歓迎です。

レイアウト.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="@dimen/smarteyeglass_control_width"
    android:layout_height="@dimen/smarteyeglass_control_height"
    android:background="@android:color/black"
    android:orientation="vertical"
    android:weightSum="2"
    tools:ignore="ContentDescription,PxUsage" >

    <ImageView 
        android:id="@+id/test_image"
        android:src="@drawable/test"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal" />

</LinearLayout>
4

1 に答える 1

0

正中線より上に描画できるはずです。次のように、layout_alignParentLeft と layout_alignParentTop を追加してみてください。

<ImageView
    android:id="@+id/image"
    android:layout_width="48px"
    android:layout_height="48px"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:layout_margin="6px"
    android:background="@drawable/shape"
    android:src="@drawable/icon_extension48" />
于 2015-09-15T18:29:34.350 に答える