在我的android應用程序中,我只需要四個角落的邊框,如圖(白色)所示。Android:邊框只在角落
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="6">
<VideoView
android:id="@+id/video1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center" />
<View
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_centerInParent="true"
android:background="@drawable/cornerbg" />
</RelativeLayout>
cornerbg.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<solid android:color="@color/transparent" />
<stroke
android:width="1dp"
android:color="@color/btn_border"
android:dashWidth="50dp" // I tried this but not getting expected
android:dashGap="60dp"/>
</shape>
</item>
</layer-list>
我如何編寫XML的呢?
請幫幫忙,謝謝
你需要這些可見的角落,在裏面的照片或作爲邊界? –
創建該四角圖像的9.png,並將其放置在圖像的佈局前面 –
@fremmedehenvendelser在邊框內。但我可以管理它,我不會將它寫入xml。我將用axml和xml更新我的問題 –