Я попытался установить фоновое изображение для основной активности в android (используя xamarin). Изображение показано в дизайне, но когда я подражаю своему телефону (Galaxy S4), не отображается. Вот код. Что здесь не так?Фоновое изображение android xamarin
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/home"
android:scaleType="fitXY" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="1"
android:layout_gravity="bottom"
android:minHeight="250dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:minHeight="125dp">
<Space
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 1"
android:layout_gravity="center" />
<Space
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Button 2" />
<Space
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:minHeight="125dp">
<Space
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 3"
android:layout_gravity="center" />
<Space
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Button 4" />
<Space
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
</GridLayout>
</LinearLayout>
</RelativeLayout>
Я использую визуальный studio 2015 для этого проекта Android, и у меня нет папки «drawable-nodpi» в решении, у меня есть только папка «drawable». Я пробовал с небольшим изображением (720x1280), потому что этот (1080x1920) и работает. Это связано с разрешением изображения, но как я могу изменить его для соответствия всем экранам? Спасибо – CalinCosmin
Вы можете добавить эту папку в свое решение внутри папки «Ресурсы» :-) – iwanlenin
Я тоже пробовал это, но он не знает, чтобы переключаться между ними. – CalinCosmin