android remoteView布局不工作

android remoteView布局不工作,android,Android,整个上午都在工作,试图找到合适的位置 文本“正在进行模拟”下的进度栏。 有人能帮我吗? 添加图片: <?xml version="1.0" encoding="UTF-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill

整个上午都在工作,试图找到合适的位置 文本“正在进行模拟”下的进度栏。 有人能帮我吗? 添加图片:

<?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>

试试这个

<?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>

如果您不想像其他答案所建议的那样使用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>


只是给你一个使用RelativeLayout属性的想法。但是android:layout_属性应该用在ProgressBar中,把它放在TextView下,正如我从问题中理解的那样。是的,layout_属性成功了谢谢Adinia。但是现在图标在进度条和文本后面。我会做一些tweeking@user538837在progressBar中,该行应为android:layout_lower=“@id/text”;此外,您应该将它们设置在图像的右侧;我只是告诉艾扎兹他的答案并不完整。再一次,你也可以试试我的另一个解决方案。谢谢阿迪尼亚,像那样包装线性布局是很好的。我很高兴,谢谢