使用时fill_parent,maxWidth没有效果.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxWidth="50dip"/>
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud) 我需要在RelativeLayout中的Button上方放置一个TextView.但它不起作用:TextView总是在Button下,即使我在按钮之前移动它.我也尝试过bringChildToFront()在前面移动textview的功能,但没有运气.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rlBottom"
android:layout_width="fill_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/bVio"
android:layout_width="wrap_content"
android:layout_height="50dip"
android:layout_alignParentLeft="true"
android:text="VIO"></Button>
<TextView
android:id="@+id/bVio_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/bVio"
android:layout_marginTop="6dip"
android:layout_marginRight="6dip"
android:text="00"
android:textSize="15dip"
android:textColor="#FF0000"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud) 它看起来像5 Android(API 21)中的错误.我需要一个textview on button,textview应该放在按钮上方.它在Android 4.1(API 16)上运行正常,在5 Android(API 21)上运行不正确.有截图和代码:
Android 4.1 - 这是正确的,按钮上方的红色文本视图

Android 5 - 它是不正确的,按钮下的红色textview!

码:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rlBottom"
android:layout_width="fill_parent"
android:layout_height="match_parent" >
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="#00FF00">
<Button
android:id="@+id/bVio"
android:layout_width="wrap_content"
android:layout_height="50dip"
android:text="VIO"></Button>
<TextView
android:id="@+id/bVio_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="00"
android:textSize="12dip"
android:textColor="#FFFFFF"
android:background="@drawable/rounded_textbox"/>
</FrameLayout>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
rounded_textbox - 它只是形状...如果删除背景,所有看起来相同,textview在5 android下的按钮下.
请指教!
我正在从麦克风录制音频并将其保存为 .mp4 - 它是 AMR 格式。如何将此音频转换为 mp3 或 AAC?我看到这篇文章,但我不明白它 - 我是 Android 新手。
有没有一些简单的 Android 库可以与 mp3 一起使用?我用谷歌搜索了一整天,什么也没找到。也许一些好人可以在这篇文章中解释并给出完整的例子,数百人将不胜感激!
谢谢。