我有一个XML布局文件,但文本不仅适合屏幕大小.为了制作一个,我需要做ScrollView什么?
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="1" >
<TableRow>
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:layout_marginTop="10dip"
android:layout_marginRight="5dip"
android:tint="#55ff0000"
android:src="@drawable/icon" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:text=" Name " />
<TextView android:id="@+id/name1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:text="Veer" />
</TableRow>
<TableRow>
<TextView android:id="@+id/age"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:text=" Age" />
<TextView android:id="@+id/age1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:text="23" />
</TableRow>
<TableRow>
<TextView android:id="@+id/gender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:text=" Gender" />
<TextView android:id="@+id/gender1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:text="Male" />
</TableRow>
<TableRow>
<TextView android:id="@+id/profession"
android:layout_width="wrap_content" …Run Code Online (Sandbox Code Playgroud) 我写了以下代码
Date d = new Date();
CharSequence s = DateFormat.format("MMMM d, yyyy ", d.getTime());
Run Code Online (Sandbox Code Playgroud)
但是问我参数,我想要字符串格式的当前日期,
喜欢
28-Dec-2011
Run Code Online (Sandbox Code Playgroud)
这样我就可以设置了TextView,
解释一下,如果你认为有必要,我是Android开发的新手.
我确实喜欢下面的内容 xml
<TableRow>
<TextView android:id="@+id/address1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:maxLines="4"
android:singleLine="false"
android:text="Johar Mor, Gulistan-e-Johar, Karachi" >
</TextView>
</TableRow>
Run Code Online (Sandbox Code Playgroud)
它不起作用multiline,我正在使用TableLayout......
那我在这做什么错呢?
detailTextLabel不可见(代码如下).你能告诉我为什么吗?
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
NSString *cellValue = [myListArray objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;
cell.detailTextLabel.text = @"Hello "; // This is not visible
cell.image = [myListArrayImages objectAtIndex:indexPath.row];
return cell;
}
Run Code Online (Sandbox Code Playgroud) 我正在上课,如下所示
// All necessary imports are here
public class More extends Activity {
String[] MoreItems = { "Transfers", "Budgets", "Branches", "Tools", "News",
"Customer Service", "Settings", "Help", "About" };
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.more_view);
ListView moreListView = (ListView) findViewById(R.id.moreListView);
MoreListAdapter listAdapter = new MoreListAdapter();
moreListView.setAdapter(listAdapter);
// accountsTypeListView.setOnItemClickListener(listClickListner);
}
class MoreListAdapter extends ArrayAdapter<String> {
MoreListAdapter() {
super(More.this, R.layout.list_item, MoreItems);
}
public View getView(int position, View convertView, ViewGroup parent) {
View row;
if (convertView == null) {
LayoutInflater inflater = …Run Code Online (Sandbox Code Playgroud) 我创建了一个GKSession,当它的对象被创建时,它开始搜索设备的可用性,如
- (void)session:(GKSession *)session peer:(NSString *)peerID didChangeState:(GKPeerConnectionState)state {
Run Code Online (Sandbox Code Playgroud)
我想在每60秒后调用一次这个方法,我该怎么办?
我想知道MKMapViewiphone编程中当前的缩放级别,我该怎么做?实际上我有一个应用程序,即少量参数(从中心到角落的半径MKMapView)正在返回商店详细信息,当我打开时MKMapView,半径非常高,当Radius较小时它会改变,所以我想要知道缩放级别并根据它设置我的webservice,如何获得当前MKMapView可见区域的缩放级别?
假设我有一个包含一些数据的对象.
如何使用NSLog查看数据?
如果有人不清楚我的问题,那么可以再问我一次.
我正在为Android开发我的第一个应用程序,现在我使用ADT运行应用程序,现在我想在Android设备上运行应用程序,我该怎么做,需要帮助.提前致谢
我想将我的应用程序的价格从0.99美元更改为免费.我在iTunesConnect上将价格等级更改为免费并保存,但这不会影响我的应用程序在App Store上显示的价格.为什么会这样?
android ×5
iphone ×4
objective-c ×2
android-date ×1
app-store ×1
cell ×1
date ×1
eclipse ×1
gksession ×1
listview ×1
mkmapview ×1
multiline ×1
nslog ×1
nstimer ×1
object ×1
scrollview ×1
tablelayout ×1
textview ×1
timer ×1
uitableview ×1