Android RemoteView макет не работает

1

Работала все утро, пытаясь разместить индикатор прогресса в тексте "Выполнение моделирования". Может ли кто-нибудь мне помочь? Добавление изображения: Изображение 174551

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:orientation="horizontal"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:padding="3dp"
          >
<ImageView android:id="@+id/image"
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:layout_marginRight="10dp"
          />
<TextView android:id="@+id/text"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textColor="#000"
          /> 
<ProgressBar
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          style="?android:attr/progressBarStyleHorizontal"
          android:id="@+id/status_progress"
          android:max="100"
          />
</LinearLayout>
Теги:

2 ответа

2
Лучший ответ

Вот вариант, если вы не хотите использовать RelativeLayout, как было предложено другим ответом.

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:orientation="horizontal"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:padding="3dp"
          >
<ImageView android:id="@+id/image"
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:layout_marginRight="10dp"
          />
<LinearLayout 
          android:orientation="vertical"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:padding="3dp"
          >
      <TextView android:id="@+id/text"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textColor="#000"
          /> 
      <ProgressBar
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          style="?android:attr/progressBarStyleHorizontal"
          android:id="@+id/status_progress"
          android:max="100"
          />
</LinearLayout>
</LinearLayout>
  • 0
    Спасибо Adinia, обернуть LinearLayout, как это здорово. Я счастлив, спасибо
1

попробуйте это

<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:orientation="horizontal"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:padding="3dp"
          >
<ImageView android:id="@+id/image"
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:layout_marginRight="10dp"
          />
<TextView android:id="@+id/text"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textColor="#000"
          android:layout_below="@+id/image"/> 
<ProgressBar
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          style="?android:attr/progressBarStyleHorizontal"
          android:id="@+id/status_progress"
          android:max="100"
          />
          </RelativeLayout>
  • 0
    Просто дать вам представление об использовании свойств RelativeLayout.
  • 0
    Но свойство android: layout_below должно использоваться в ProgressBar, чтобы поместить его в TextView, как я понял из вопроса.
Показать ещё 2 комментария

Ещё вопросы

Сообщество Overcoder
Наверх
Меню