Android Studio XML - How to get imageview in front of button?

扶醉桌前 提交于 2019-12-13 18:48:57

问题


The question is quite simple. How do I get this imageview below to be visible in front of the button below?

I am looking for an XML answer, not a Java answer. Seeing java (I think) will not change anything in the preview screen while working on the xml file.

 <ImageView
        android:layout_width="35dp"
        android:layout_height="35dp"
        android:background="@drawable/iconfb"
        android:layout_marginTop="90dp"
        android:layout_marginLeft="12.5pt"
        android:id="@+id/iconfb"
        />

    <Button
        android:layout_width="300dp"
        android:layout_height="40dp"
        android:text="Sign in with facebook"
        android:onClick="invokefb"
        android:textColor="@color/white"
        android:textStyle="bold"
        android:background="@color/tmfacebook"
        android:layout_marginTop="-20dp"
        android:layout_marginLeft="12.5pt"
    android:id="@+id/fblogin"
    "/>

回答1:


<Button 
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:drawablePadding="10dp"
        android:drawableLeft="@drawable/fb"
        android:text="Facebook"/>


来源:https://stackoverflow.com/questions/31685210/android-studio-xml-how-to-get-imageview-in-front-of-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!