有人可以帮助我如何使用这个属性android:layoutDirection,
请不要向我推荐这个问题Android上的Right To Left语言的状态是什么?因为它没有回答我的问题!
我正在创建一个应用程序,我在这里创建一个像这个图像的布局,

但我希望图像的上半部分应该是其他颜色,但颜色应该是透明的,以便从该颜色可以看到背景.我正在使用样式xml,
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke android:width="2dp" android:color="#FFFFFFFF" />
<gradient android:startColor="#DD000000" android:endColor="#DD2ECCFA"
android:angle="225"/>
<corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp"
android:topLeftRadius="7dp" android:topRightRadius="7dp"/>
</shape>
Run Code Online (Sandbox Code Playgroud)
但它正在创建一个不透明的颜色布局,并且从该颜色看不到背景.提出一些使颜色透明的技巧,这样我就可以获得玻璃般的布局外观.
我正在为我的android应用程序进行国际化.这是我尝试从中获取字符串的方式string.xml
tv.setText(context.getResources().getString(R.string.));
Run Code Online (Sandbox Code Playgroud)
但Eclipse没有提出任何我预先定义的字符串,只是标准Android Strings.我的文件夹结构如下所示:
res/values/strings.xml
Run Code Online (Sandbox Code Playgroud)
和
res/values-NO/strings.xml
Run Code Online (Sandbox Code Playgroud)
我可以看到这些文件中的字符串在文件中有一些内存地址,R.java例如:
public static final int enterPassword=0x7f06003c;
Run Code Online (Sandbox Code Playgroud)
我尝试Clean了Project,但奇怪的是eclipse并没有提出任何建议,字符串存在于R.java
问题出在哪儿 ?
我想像ipad一样拆分屏幕.我不知道确切的名字.任何人都知道我该怎么做或者这个例子?
我正在研究一个计算器项目.我实现工作的类无法看到XML布局.当我使用时setContentView(R.layout.),它没有看到任何xml文件.虽然欢迎类工作正常,并将其内容视图设置为欢迎XML.
谁能告诉我为什么这是一个错误?
这是我的Activity XML的布局:

出于某种原因,我无法在屏幕底部看到该按钮.这是代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/app_bg"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_transparent"
android:orientation="vertical"
android:minHeight="44dip"
android:minWidth="44dip" >
<TextView
android:id="@+id/lblNotesCount"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="@color/lblNotesCountColor" />
<TextView
android:id="@+id/lblTxtNotes"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="@color/lblNotesCountColor" />
</LinearLayout>
<TextView
android:id="@+id/txtActivityListByCategory_Header"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical|center_horizontal"
android:paddingLeft="2dp"
android:singleLine="true"
android:textStyle="bold"
android:textColor="@color/color_WHITE" />
<Button
android:id="@+id/btnAddNote"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_new_note_selector"
android:minHeight="44dip"
android:minWidth="44dip" />
</LinearLayout>
<TextView
android:id="@+id/emptyList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="2dp"
android:text="@string/txtEmptyList"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/emptyList" />
<ListView
android:id="@+id/lstNotesByCategory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawSelectorOnTop="false" …Run Code Online (Sandbox Code Playgroud) 我有一个视频视图,播放某个视频,这是他的xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="match_parent">
Some other views
<VideoView
android:id = "@+id/video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_gravity="center"
android:layout_alignParentStart="true"
/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
我正在尝试将视频居中放置,但是无论何时我播放视频,它都不会出现在中心位置,并且位置会有所不同,具体取决于视频,如何将其居中?
我正在制作一个应用程序,我正在使用sqlite数据库.在第一次启动我的应用程序和onUpdate时,我将从xml文件向sqlite db添加数据.因此,在我的应用程序的第一次启动时,它显示我白屏约15秒.我想要显示我的全屏幕,约15秒.我怎么能这样做?
在主要活动中,我创建了两个用作选项卡式菜单的片段.其中一个片段包含一个列表,其中列表项在单击时开始新活动.我想使用Up Action/Navigation按钮从新活动返回到片段(列表),但不显示任何列表,只显示空标签.我已将parent活动声明为manifest.xml中的主要活动.
当我使用手机的后退按钮时它工作正常.
List是在fragment的onViewCreated方法中创建的.
清单:
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Main2Activity"
android:parentActivityName=".MainActivity" >
</activity>
</application>
Run Code Online (Sandbox Code Playgroud)
使用listView启动新活动的片段:
public static class frag extends Fragment {
private static final String ARG_SECTION_NUMBER = "section_number";
public frag() {
}
public static frag newInstance(int sectionNumber) {
frag fragment = new rangingFrag();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) …Run Code Online (Sandbox Code Playgroud) So I have a standard RecyclerView that takes a list of posts and displays them to the user. My problem is when the user comes into the activity, I want to be able to change the focus to a particular post.
Ex. User A sees that he has a notification that of someone has liked his/her post. He/she clicks that notification, and it loads the activity of user's post, and then the focus changes to the position of the post …
android ×10
android-layout ×10
android-xml ×2
aero-glass ×1
background ×1
image ×1
java ×1
screen ×1
seconds ×1
split ×1